Text Generation
Safetensors
GGUF
English
reasoning
reinforcement-learning
grpo
small-language-model
samsung-ennovatex
conversational
Instructions to use OmnipotentFool/Aurvion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use OmnipotentFool/Aurvion with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf OmnipotentFool/Aurvion:Q4_K_M # Run inference directly in the terminal: llama cli -hf OmnipotentFool/Aurvion:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf OmnipotentFool/Aurvion:Q4_K_M # Run inference directly in the terminal: llama cli -hf OmnipotentFool/Aurvion:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf OmnipotentFool/Aurvion:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf OmnipotentFool/Aurvion:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf OmnipotentFool/Aurvion:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf OmnipotentFool/Aurvion:Q4_K_M
Use Docker
docker model run hf.co/OmnipotentFool/Aurvion:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use OmnipotentFool/Aurvion with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OmnipotentFool/Aurvion" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OmnipotentFool/Aurvion", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/OmnipotentFool/Aurvion:Q4_K_M
- Ollama
How to use OmnipotentFool/Aurvion with Ollama:
ollama run hf.co/OmnipotentFool/Aurvion:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use OmnipotentFool/Aurvion with Docker Model Runner:
docker model run hf.co/OmnipotentFool/Aurvion:Q4_K_M
- Lemonade
How to use OmnipotentFool/Aurvion with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull OmnipotentFool/Aurvion:Q4_K_M
Run and chat with the model
lemonade run user.Aurvion-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/README.md +15 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/_browser-chunks/chunk-2FVV6YOY.js +186 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/_browser-chunks/chunk-4BE7D4DS.js +9 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/_browser-chunks/chunk-7OPMK7TU.js +116 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/_browser-chunks/matchers-5TDFFDYO.js +1263 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/index.d.ts +73 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/index.js +15 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/manager.js +2181 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/postinstall.js +24 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/preview.d.ts +53 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/preview.js +14 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/README.md +156 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/Color-6BZIO3FS.js +1096 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/DocsRenderer-LL677BLK.js +9 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/chunk-AAVP3AE4.js +949 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/chunk-CYSK6WYR.js +7 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/chunk-OATZR77O.js +52 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/chunk-S4QKU6I5.js +31 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/chunk-SL3VIQZ3.js +31 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/chunk-2SCGLXP5.js +196 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/chunk-4WYSRR6Q.js +168 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/chunk-G6W4HXRC.js +42 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/chunk-SOR3F7GI.js +0 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/mdx-plugin-P3ASKRBX.js +1032 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/rehype-external-links-B457SAPO.js +121 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/rehype-slug-QMVSHJMP.js +93 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/angular/index.d.ts +3 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/angular/index.js +9 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/blocks.d.ts +1083 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/blocks.js +0 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/ember/index.d.ts +3 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/ember/index.js +9 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/index.d.ts +270 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/index.js +15 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/manager.js +82 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/mdx-loader.js +36 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/mdx-react-shim.d.ts +1 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/mdx-react-shim.js +2 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/preset.js +421 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/preview.d.ts +3 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/preview.js +7 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/web-components/index.d.ts +2 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/web-components/index.js +0 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/LICENSE +21 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/README.md +387 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/dist/compiler/plugins.d.ts +12 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/dist/compiler/plugins.js +106 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/dist/compiler/post-transform/appendix/create-export-order.d.ts +8 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/dist/compiler/post-transform/appendix/create-export-order.js +23 -0
- llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/dist/compiler/post-transform/appendix/create-import.d.ts +5 -0
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Storybook Accessibility Addon
|
| 2 |
+
|
| 3 |
+
The @storybook/addon-a11y package provides accessibility testing for Storybook stories. It uses axe-core to run the tests.
|
| 4 |
+
|
| 5 |
+
## Getting Started
|
| 6 |
+
|
| 7 |
+
### Add the addon to an existing Storybook
|
| 8 |
+
|
| 9 |
+
```bash
|
| 10 |
+
npx storybook add @storybook/addon-a11y
|
| 11 |
+
```
|
| 12 |
+
|
| 13 |
+
[More on getting started with the accessibility addon](https://storybook.js.org/docs/writing-tests/accessibility-testing#accessibility-checks-with-a11y-addon?ref=readme)
|
| 14 |
+
|
| 15 |
+
Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=readme).
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/_browser-chunks/chunk-2FVV6YOY.js
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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from "./chunk-7OPMK7TU.js";
|
| 7 |
+
import {
|
| 8 |
+
__export
|
| 9 |
+
} from "./chunk-4BE7D4DS.js";
|
| 10 |
+
|
| 11 |
+
// src/preview.tsx
|
| 12 |
+
var preview_exports = {};
|
| 13 |
+
__export(preview_exports, {
|
| 14 |
+
afterEach: () => afterEach,
|
| 15 |
+
decorators: () => decorators,
|
| 16 |
+
initialGlobals: () => initialGlobals,
|
| 17 |
+
parameters: () => parameters
|
| 18 |
+
});
|
| 19 |
+
import { expect } from "storybook/test";
|
| 20 |
+
|
| 21 |
+
// src/a11yRunner.ts
|
| 22 |
+
import { ElementA11yParameterError } from "storybook/internal/preview-errors";
|
| 23 |
+
import { global as global2 } from "@storybook/global";
|
| 24 |
+
import { addons, waitForAnimations } from "storybook/preview-api";
|
| 25 |
+
|
| 26 |
+
// src/a11yRunnerUtils.ts
|
| 27 |
+
import { global } from "@storybook/global";
|
| 28 |
+
var { document: document2 } = global, withLinkPaths = (results, storyId) => {
|
| 29 |
+
let pathname = document2.location.pathname.replace(/iframe\.html$/, ""), enhancedResults = { ...results };
|
| 30 |
+
return ["incomplete", "passes", "violations"].forEach((key) => {
|
| 31 |
+
Array.isArray(results[key]) && (enhancedResults[key] = results[key].map((result) => ({
|
| 32 |
+
...result,
|
| 33 |
+
nodes: result.nodes.map((node, index) => {
|
| 34 |
+
let id = `${key}.${result.id}.${index + 1}`, linkPath = `${pathname}?path=/story/${storyId}&addonPanel=${PANEL_ID}&a11ySelection=${id}`;
|
| 35 |
+
return { id, ...node, linkPath };
|
| 36 |
+
})
|
| 37 |
+
})));
|
| 38 |
+
}), enhancedResults;
|
| 39 |
+
};
|
| 40 |
+
|
| 41 |
+
// src/a11yRunner.ts
|
| 42 |
+
var { document: document3 } = global2, channel = addons.getChannel(), DEFAULT_PARAMETERS = { config: {}, options: {} }, DISABLED_RULES = [
|
| 43 |
+
// In component testing, landmarks are not always present
|
| 44 |
+
// and the rule check can cause false positives
|
| 45 |
+
"region"
|
| 46 |
+
], queue = [], isRunning = !1, runNext = async () => {
|
| 47 |
+
if (queue.length === 0) {
|
| 48 |
+
isRunning = !1;
|
| 49 |
+
return;
|
| 50 |
+
}
|
| 51 |
+
isRunning = !0;
|
| 52 |
+
let next = queue.shift();
|
| 53 |
+
next && await next(), runNext();
|
| 54 |
+
}, run = async (input = DEFAULT_PARAMETERS, storyId) => {
|
| 55 |
+
let axe = (await import("axe-core"))?.default || globalThis.axe, { config = {}, options = {} } = input;
|
| 56 |
+
if (input.element)
|
| 57 |
+
throw new ElementA11yParameterError();
|
| 58 |
+
let context = {
|
| 59 |
+
include: document3?.body,
|
| 60 |
+
exclude: [".sb-wrapper", "#storybook-docs", "#storybook-highlights-root"]
|
| 61 |
+
// Internal Storybook elements that are always in the document
|
| 62 |
+
};
|
| 63 |
+
if (input.context) {
|
| 64 |
+
let hasInclude = typeof input.context == "object" && "include" in input.context && input.context.include !== void 0, hasExclude = typeof input.context == "object" && "exclude" in input.context && input.context.exclude !== void 0;
|
| 65 |
+
hasInclude ? context.include = input.context.include : !hasInclude && !hasExclude && (context.include = input.context), hasExclude && (context.exclude = context.exclude.concat(input.context.exclude));
|
| 66 |
+
}
|
| 67 |
+
axe.reset();
|
| 68 |
+
let configWithDefault = {
|
| 69 |
+
...config,
|
| 70 |
+
rules: [...DISABLED_RULES.map((id) => ({ id, enabled: !1 })), ...config?.rules ?? []]
|
| 71 |
+
};
|
| 72 |
+
return axe.configure(configWithDefault), new Promise((resolve, reject) => {
|
| 73 |
+
let highlightsRoot = document3?.getElementById("storybook-highlights-root");
|
| 74 |
+
highlightsRoot && (highlightsRoot.style.display = "none");
|
| 75 |
+
let task = async () => {
|
| 76 |
+
try {
|
| 77 |
+
let result = await axe.run(context, options), resultWithLinks = withLinkPaths(result, storyId);
|
| 78 |
+
resolve(resultWithLinks);
|
| 79 |
+
} catch (error) {
|
| 80 |
+
reject(error);
|
| 81 |
+
}
|
| 82 |
+
};
|
| 83 |
+
queue.push(task), isRunning || runNext(), highlightsRoot && (highlightsRoot.style.display = "");
|
| 84 |
+
});
|
| 85 |
+
};
|
| 86 |
+
channel.on(EVENTS.MANUAL, async (storyId, input = DEFAULT_PARAMETERS) => {
|
| 87 |
+
try {
|
| 88 |
+
await waitForAnimations();
|
| 89 |
+
let result = await run(input, storyId), resultJson = JSON.parse(JSON.stringify(result));
|
| 90 |
+
channel.emit(EVENTS.RESULT, resultJson, storyId);
|
| 91 |
+
} catch (error) {
|
| 92 |
+
channel.emit(EVENTS.ERROR, error);
|
| 93 |
+
}
|
| 94 |
+
});
|
| 95 |
+
|
| 96 |
+
// src/utils.ts
|
| 97 |
+
function getIsVitestStandaloneRun() {
|
| 98 |
+
try {
|
| 99 |
+
return import.meta.env.VITEST_STORYBOOK === "false";
|
| 100 |
+
} catch {
|
| 101 |
+
return !1;
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
// src/withVisionSimulator.ts
|
| 106 |
+
import { useCallback, useEffect } from "storybook/preview-api";
|
| 107 |
+
var knownFilters = Object.values(filters).map((f) => f.filter), knownFiltersRegExp = new RegExp(`\\b(${knownFilters.join("|")})\\b`, "g"), withVisionSimulator = (StoryFn, { globals }) => {
|
| 108 |
+
let { vision } = globals, applyVisionFilter = useCallback(() => {
|
| 109 |
+
let existingFilters = document.body.style.filter.replaceAll(knownFiltersRegExp, "").trim(), visionFilter = filters[vision]?.filter;
|
| 110 |
+
return visionFilter && document.body.classList.contains("sb-show-main") ? !existingFilters || existingFilters === "none" ? document.body.style.filter = visionFilter : document.body.style.filter = `${existingFilters} ${visionFilter}` : document.body.style.filter = existingFilters || "none", () => document.body.style.filter = existingFilters || "none";
|
| 111 |
+
}, [vision]);
|
| 112 |
+
return useEffect(() => {
|
| 113 |
+
let cleanup = applyVisionFilter(), observer = new MutationObserver(() => applyVisionFilter());
|
| 114 |
+
return observer.observe(document.body, { attributeFilter: ["class"] }), () => {
|
| 115 |
+
cleanup(), observer.disconnect();
|
| 116 |
+
};
|
| 117 |
+
}, [applyVisionFilter]), useEffect(() => (document.body.insertAdjacentHTML("beforeend", filterDefs), () => {
|
| 118 |
+
let filterDefsElement = document.getElementById("storybook-a11y-vision-filters");
|
| 119 |
+
filterDefsElement?.parentElement?.removeChild(filterDefsElement);
|
| 120 |
+
}), []), StoryFn();
|
| 121 |
+
};
|
| 122 |
+
|
| 123 |
+
// src/preview.tsx
|
| 124 |
+
var vitestMatchersExtended = !1, decorators = [withVisionSimulator], afterEach = async ({
|
| 125 |
+
id: storyId,
|
| 126 |
+
reporting,
|
| 127 |
+
parameters: parameters2,
|
| 128 |
+
globals,
|
| 129 |
+
viewMode
|
| 130 |
+
}) => {
|
| 131 |
+
let a11yParameter = parameters2.a11y, a11yGlobals = globals.a11y, shouldRunEnvironmentIndependent = !!!globals.ghostStories && a11yParameter?.disable !== !0 && a11yParameter?.test !== "off" && a11yGlobals?.manual !== !0, getMode = () => {
|
| 132 |
+
switch (a11yParameter?.test) {
|
| 133 |
+
case "todo":
|
| 134 |
+
return "warning";
|
| 135 |
+
case "error":
|
| 136 |
+
default:
|
| 137 |
+
return "failed";
|
| 138 |
+
}
|
| 139 |
+
};
|
| 140 |
+
if (shouldRunEnvironmentIndependent && viewMode === "story")
|
| 141 |
+
try {
|
| 142 |
+
let result = await run(a11yParameter, storyId);
|
| 143 |
+
if (result) {
|
| 144 |
+
let hasViolations = (result?.violations.length ?? 0) > 0;
|
| 145 |
+
if (reporting.addReport({
|
| 146 |
+
type: "a11y",
|
| 147 |
+
version: 1,
|
| 148 |
+
result,
|
| 149 |
+
status: hasViolations ? getMode() : "passed"
|
| 150 |
+
}), getIsVitestStandaloneRun() && hasViolations && getMode() === "failed") {
|
| 151 |
+
if (!vitestMatchersExtended) {
|
| 152 |
+
let { toHaveNoViolations } = await import("./matchers-5TDFFDYO.js");
|
| 153 |
+
expect.extend({ toHaveNoViolations }), vitestMatchersExtended = !0;
|
| 154 |
+
}
|
| 155 |
+
expect(result).toHaveNoViolations();
|
| 156 |
+
}
|
| 157 |
+
}
|
| 158 |
+
} catch (e) {
|
| 159 |
+
if (reporting.addReport({
|
| 160 |
+
type: "a11y",
|
| 161 |
+
version: 1,
|
| 162 |
+
result: {
|
| 163 |
+
error: e
|
| 164 |
+
},
|
| 165 |
+
status: "failed"
|
| 166 |
+
}), getIsVitestStandaloneRun())
|
| 167 |
+
throw e;
|
| 168 |
+
}
|
| 169 |
+
}, initialGlobals = {
|
| 170 |
+
a11y: {
|
| 171 |
+
manual: !1
|
| 172 |
+
},
|
| 173 |
+
vision: void 0
|
| 174 |
+
}, parameters = {
|
| 175 |
+
a11y: {
|
| 176 |
+
test: "todo"
|
| 177 |
+
}
|
| 178 |
+
};
|
| 179 |
+
|
| 180 |
+
export {
|
| 181 |
+
decorators,
|
| 182 |
+
afterEach,
|
| 183 |
+
initialGlobals,
|
| 184 |
+
parameters,
|
| 185 |
+
preview_exports
|
| 186 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/_browser-chunks/chunk-4BE7D4DS.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var __defProp = Object.defineProperty;
|
| 2 |
+
var __export = (target, all) => {
|
| 3 |
+
for (var name in all)
|
| 4 |
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
| 5 |
+
};
|
| 6 |
+
|
| 7 |
+
export {
|
| 8 |
+
__export
|
| 9 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/_browser-chunks/chunk-7OPMK7TU.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// src/constants.ts
|
| 2 |
+
var ADDON_ID = "storybook/a11y", PANEL_ID = `${ADDON_ID}/panel`, PARAM_KEY = "a11y", VISION_GLOBAL_KEY = "vision", UI_STATE_ID = `${ADDON_ID}/ui`, RESULT = `${ADDON_ID}/result`, REQUEST = `${ADDON_ID}/request`, RUNNING = `${ADDON_ID}/running`, ERROR = `${ADDON_ID}/error`, MANUAL = `${ADDON_ID}/manual`, SELECT = `${ADDON_ID}/select`, DOCUMENTATION_LINK = "writing-tests/accessibility-testing", DOCUMENTATION_DISCREPANCY_LINK = `${DOCUMENTATION_LINK}#why-are-my-tests-failing-in-different-environments`;
|
| 3 |
+
var EVENTS = { RESULT, REQUEST, RUNNING, ERROR, MANUAL, SELECT }, STATUS_TYPE_ID_COMPONENT_TEST = "storybook/component-test", STATUS_TYPE_ID_A11Y = "storybook/a11y";
|
| 4 |
+
|
| 5 |
+
// src/visionSimulatorFilters.ts
|
| 6 |
+
var filters = {
|
| 7 |
+
blurred: {
|
| 8 |
+
label: "Blurred vision",
|
| 9 |
+
filter: "blur(2px)",
|
| 10 |
+
percentage: 22.9
|
| 11 |
+
},
|
| 12 |
+
deuteranomaly: {
|
| 13 |
+
label: "Deuteranomaly",
|
| 14 |
+
filter: 'url("#storybook-a11y-vision-deuteranomaly")',
|
| 15 |
+
percentage: 2.7
|
| 16 |
+
},
|
| 17 |
+
deuteranopia: {
|
| 18 |
+
label: "Deuteranopia",
|
| 19 |
+
filter: 'url("#storybook-a11y-vision-deuteranopia")',
|
| 20 |
+
percentage: 0.56
|
| 21 |
+
},
|
| 22 |
+
protanomaly: {
|
| 23 |
+
label: "Protanomaly",
|
| 24 |
+
filter: 'url("#storybook-a11y-vision-protanomaly")',
|
| 25 |
+
percentage: 0.66
|
| 26 |
+
},
|
| 27 |
+
protanopia: {
|
| 28 |
+
label: "Protanopia",
|
| 29 |
+
filter: 'url("#storybook-a11y-vision-protanopia")',
|
| 30 |
+
percentage: 0.59
|
| 31 |
+
},
|
| 32 |
+
tritanomaly: {
|
| 33 |
+
label: "Tritanomaly",
|
| 34 |
+
filter: 'url("#storybook-a11y-vision-tritanomaly")',
|
| 35 |
+
percentage: 0.01
|
| 36 |
+
},
|
| 37 |
+
tritanopia: {
|
| 38 |
+
label: "Tritanopia",
|
| 39 |
+
filter: 'url("#storybook-a11y-vision-tritanopia")',
|
| 40 |
+
percentage: 0.016
|
| 41 |
+
},
|
| 42 |
+
achromatopsia: {
|
| 43 |
+
label: "Achromatopsia",
|
| 44 |
+
filter: 'url("#storybook-a11y-vision-achromatopsia")',
|
| 45 |
+
percentage: 1e-4
|
| 46 |
+
},
|
| 47 |
+
grayscale: {
|
| 48 |
+
label: "Grayscale",
|
| 49 |
+
filter: "grayscale(100%)"
|
| 50 |
+
}
|
| 51 |
+
}, filterDefs = `<svg id="storybook-a11y-vision-filters" style="display: none !important;">
|
| 52 |
+
<defs>
|
| 53 |
+
<filter id="storybook-a11y-vision-protanopia">
|
| 54 |
+
<feColorMatrix
|
| 55 |
+
in="SourceGraphic"
|
| 56 |
+
type="matrix"
|
| 57 |
+
values="0.567, 0.433, 0, 0, 0 0.558, 0.442, 0, 0, 0 0, 0.242, 0.758, 0, 0 0, 0, 0, 1, 0"
|
| 58 |
+
/>
|
| 59 |
+
</filter>
|
| 60 |
+
<filter id="storybook-a11y-vision-protanomaly">
|
| 61 |
+
<feColorMatrix
|
| 62 |
+
in="SourceGraphic"
|
| 63 |
+
type="matrix"
|
| 64 |
+
values="0.817, 0.183, 0, 0, 0 0.333, 0.667, 0, 0, 0 0, 0.125, 0.875, 0, 0 0, 0, 0, 1, 0"
|
| 65 |
+
/>
|
| 66 |
+
</filter>
|
| 67 |
+
<filter id="storybook-a11y-vision-deuteranopia">
|
| 68 |
+
<feColorMatrix
|
| 69 |
+
in="SourceGraphic"
|
| 70 |
+
type="matrix"
|
| 71 |
+
values="0.625, 0.375, 0, 0, 0 0.7, 0.3, 0, 0, 0 0, 0.3, 0.7, 0, 0 0, 0, 0, 1, 0"
|
| 72 |
+
/>
|
| 73 |
+
</filter>
|
| 74 |
+
<filter id="storybook-a11y-vision-deuteranomaly">
|
| 75 |
+
<feColorMatrix
|
| 76 |
+
in="SourceGraphic"
|
| 77 |
+
type="matrix"
|
| 78 |
+
values="0.8, 0.2, 0, 0, 0 0.258, 0.742, 0, 0, 0 0, 0.142, 0.858, 0, 0 0, 0, 0, 1, 0"
|
| 79 |
+
/>
|
| 80 |
+
</filter>
|
| 81 |
+
<filter id="storybook-a11y-vision-tritanopia">
|
| 82 |
+
<feColorMatrix
|
| 83 |
+
in="SourceGraphic"
|
| 84 |
+
type="matrix"
|
| 85 |
+
values="0.95, 0.05, 0, 0, 0 0, 0.433, 0.567, 0, 0 0, 0.475, 0.525, 0, 0 0, 0, 0, 1, 0"
|
| 86 |
+
/>
|
| 87 |
+
</filter>
|
| 88 |
+
<filter id="storybook-a11y-vision-tritanomaly">
|
| 89 |
+
<feColorMatrix
|
| 90 |
+
in="SourceGraphic"
|
| 91 |
+
type="matrix"
|
| 92 |
+
values="0.967, 0.033, 0, 0, 0 0, 0.733, 0.267, 0, 0 0, 0.183, 0.817, 0, 0 0, 0, 0, 1, 0"
|
| 93 |
+
/>
|
| 94 |
+
</filter>
|
| 95 |
+
<filter id="storybook-a11y-vision-achromatopsia">
|
| 96 |
+
<feColorMatrix
|
| 97 |
+
in="SourceGraphic"
|
| 98 |
+
type="matrix"
|
| 99 |
+
values="0.299, 0.587, 0.114, 0, 0 0.299, 0.587, 0.114, 0, 0 0.299, 0.587, 0.114, 0, 0 0, 0, 0, 1, 0"
|
| 100 |
+
/>
|
| 101 |
+
</filter>
|
| 102 |
+
</defs>
|
| 103 |
+
</svg>`;
|
| 104 |
+
|
| 105 |
+
export {
|
| 106 |
+
ADDON_ID,
|
| 107 |
+
PANEL_ID,
|
| 108 |
+
PARAM_KEY,
|
| 109 |
+
VISION_GLOBAL_KEY,
|
| 110 |
+
DOCUMENTATION_DISCREPANCY_LINK,
|
| 111 |
+
EVENTS,
|
| 112 |
+
STATUS_TYPE_ID_COMPONENT_TEST,
|
| 113 |
+
STATUS_TYPE_ID_A11Y,
|
| 114 |
+
filters,
|
| 115 |
+
filterDefs
|
| 116 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/_browser-chunks/matchers-5TDFFDYO.js
ADDED
|
@@ -0,0 +1,1263 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import "./chunk-4BE7D4DS.js";
|
| 2 |
+
|
| 3 |
+
// ../../../node_modules/vitest-axe/node_modules/chalk/source/vendor/ansi-styles/index.js
|
| 4 |
+
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`, wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`, styles = {
|
| 5 |
+
modifier: {
|
| 6 |
+
reset: [0, 0],
|
| 7 |
+
// 21 isn't widely supported and 22 does the same thing
|
| 8 |
+
bold: [1, 22],
|
| 9 |
+
dim: [2, 22],
|
| 10 |
+
italic: [3, 23],
|
| 11 |
+
underline: [4, 24],
|
| 12 |
+
overline: [53, 55],
|
| 13 |
+
inverse: [7, 27],
|
| 14 |
+
hidden: [8, 28],
|
| 15 |
+
strikethrough: [9, 29]
|
| 16 |
+
},
|
| 17 |
+
color: {
|
| 18 |
+
black: [30, 39],
|
| 19 |
+
red: [31, 39],
|
| 20 |
+
green: [32, 39],
|
| 21 |
+
yellow: [33, 39],
|
| 22 |
+
blue: [34, 39],
|
| 23 |
+
magenta: [35, 39],
|
| 24 |
+
cyan: [36, 39],
|
| 25 |
+
white: [37, 39],
|
| 26 |
+
// Bright color
|
| 27 |
+
blackBright: [90, 39],
|
| 28 |
+
gray: [90, 39],
|
| 29 |
+
// Alias of `blackBright`
|
| 30 |
+
grey: [90, 39],
|
| 31 |
+
// Alias of `blackBright`
|
| 32 |
+
redBright: [91, 39],
|
| 33 |
+
greenBright: [92, 39],
|
| 34 |
+
yellowBright: [93, 39],
|
| 35 |
+
blueBright: [94, 39],
|
| 36 |
+
magentaBright: [95, 39],
|
| 37 |
+
cyanBright: [96, 39],
|
| 38 |
+
whiteBright: [97, 39]
|
| 39 |
+
},
|
| 40 |
+
bgColor: {
|
| 41 |
+
bgBlack: [40, 49],
|
| 42 |
+
bgRed: [41, 49],
|
| 43 |
+
bgGreen: [42, 49],
|
| 44 |
+
bgYellow: [43, 49],
|
| 45 |
+
bgBlue: [44, 49],
|
| 46 |
+
bgMagenta: [45, 49],
|
| 47 |
+
bgCyan: [46, 49],
|
| 48 |
+
bgWhite: [47, 49],
|
| 49 |
+
// Bright color
|
| 50 |
+
bgBlackBright: [100, 49],
|
| 51 |
+
bgGray: [100, 49],
|
| 52 |
+
// Alias of `bgBlackBright`
|
| 53 |
+
bgGrey: [100, 49],
|
| 54 |
+
// Alias of `bgBlackBright`
|
| 55 |
+
bgRedBright: [101, 49],
|
| 56 |
+
bgGreenBright: [102, 49],
|
| 57 |
+
bgYellowBright: [103, 49],
|
| 58 |
+
bgBlueBright: [104, 49],
|
| 59 |
+
bgMagentaBright: [105, 49],
|
| 60 |
+
bgCyanBright: [106, 49],
|
| 61 |
+
bgWhiteBright: [107, 49]
|
| 62 |
+
}
|
| 63 |
+
}, modifierNames = Object.keys(styles.modifier), foregroundColorNames = Object.keys(styles.color), backgroundColorNames = Object.keys(styles.bgColor), colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
| 64 |
+
function assembleStyles() {
|
| 65 |
+
let codes = /* @__PURE__ */ new Map();
|
| 66 |
+
for (let [groupName, group] of Object.entries(styles)) {
|
| 67 |
+
for (let [styleName, style] of Object.entries(group))
|
| 68 |
+
styles[styleName] = {
|
| 69 |
+
open: `\x1B[${style[0]}m`,
|
| 70 |
+
close: `\x1B[${style[1]}m`
|
| 71 |
+
}, group[styleName] = styles[styleName], codes.set(style[0], style[1]);
|
| 72 |
+
Object.defineProperty(styles, groupName, {
|
| 73 |
+
value: group,
|
| 74 |
+
enumerable: !1
|
| 75 |
+
});
|
| 76 |
+
}
|
| 77 |
+
return Object.defineProperty(styles, "codes", {
|
| 78 |
+
value: codes,
|
| 79 |
+
enumerable: !1
|
| 80 |
+
}), styles.color.close = "\x1B[39m", styles.bgColor.close = "\x1B[49m", styles.color.ansi = wrapAnsi16(), styles.color.ansi256 = wrapAnsi256(), styles.color.ansi16m = wrapAnsi16m(), styles.bgColor.ansi = wrapAnsi16(10), styles.bgColor.ansi256 = wrapAnsi256(10), styles.bgColor.ansi16m = wrapAnsi16m(10), Object.defineProperties(styles, {
|
| 81 |
+
rgbToAnsi256: {
|
| 82 |
+
value(red, green, blue) {
|
| 83 |
+
return red === green && green === blue ? red < 8 ? 16 : red > 248 ? 231 : Math.round((red - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
| 84 |
+
},
|
| 85 |
+
enumerable: !1
|
| 86 |
+
},
|
| 87 |
+
hexToRgb: {
|
| 88 |
+
value(hex) {
|
| 89 |
+
let matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
| 90 |
+
if (!matches)
|
| 91 |
+
return [0, 0, 0];
|
| 92 |
+
let [colorString] = matches;
|
| 93 |
+
colorString.length === 3 && (colorString = [...colorString].map((character) => character + character).join(""));
|
| 94 |
+
let integer = Number.parseInt(colorString, 16);
|
| 95 |
+
return [
|
| 96 |
+
/* eslint-disable no-bitwise */
|
| 97 |
+
integer >> 16 & 255,
|
| 98 |
+
integer >> 8 & 255,
|
| 99 |
+
integer & 255
|
| 100 |
+
/* eslint-enable no-bitwise */
|
| 101 |
+
];
|
| 102 |
+
},
|
| 103 |
+
enumerable: !1
|
| 104 |
+
},
|
| 105 |
+
hexToAnsi256: {
|
| 106 |
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
| 107 |
+
enumerable: !1
|
| 108 |
+
},
|
| 109 |
+
ansi256ToAnsi: {
|
| 110 |
+
value(code) {
|
| 111 |
+
if (code < 8)
|
| 112 |
+
return 30 + code;
|
| 113 |
+
if (code < 16)
|
| 114 |
+
return 90 + (code - 8);
|
| 115 |
+
let red, green, blue;
|
| 116 |
+
if (code >= 232)
|
| 117 |
+
red = ((code - 232) * 10 + 8) / 255, green = red, blue = red;
|
| 118 |
+
else {
|
| 119 |
+
code -= 16;
|
| 120 |
+
let remainder = code % 36;
|
| 121 |
+
red = Math.floor(code / 36) / 5, green = Math.floor(remainder / 6) / 5, blue = remainder % 6 / 5;
|
| 122 |
+
}
|
| 123 |
+
let value = Math.max(red, green, blue) * 2;
|
| 124 |
+
if (value === 0)
|
| 125 |
+
return 30;
|
| 126 |
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
| 127 |
+
return value === 2 && (result += 60), result;
|
| 128 |
+
},
|
| 129 |
+
enumerable: !1
|
| 130 |
+
},
|
| 131 |
+
rgbToAnsi: {
|
| 132 |
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
| 133 |
+
enumerable: !1
|
| 134 |
+
},
|
| 135 |
+
hexToAnsi: {
|
| 136 |
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
| 137 |
+
enumerable: !1
|
| 138 |
+
}
|
| 139 |
+
}), styles;
|
| 140 |
+
}
|
| 141 |
+
var ansiStyles = assembleStyles(), ansi_styles_default = ansiStyles;
|
| 142 |
+
|
| 143 |
+
// ../../../node_modules/vitest-axe/node_modules/chalk/source/vendor/supports-color/browser.js
|
| 144 |
+
var level = (() => {
|
| 145 |
+
if (!("navigator" in globalThis))
|
| 146 |
+
return 0;
|
| 147 |
+
if (globalThis.navigator.userAgentData) {
|
| 148 |
+
let brand = navigator.userAgentData.brands.find(({ brand: brand2 }) => brand2 === "Chromium");
|
| 149 |
+
if (brand && brand.version > 93)
|
| 150 |
+
return 3;
|
| 151 |
+
}
|
| 152 |
+
return /\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent) ? 1 : 0;
|
| 153 |
+
})(), colorSupport = level !== 0 && {
|
| 154 |
+
level,
|
| 155 |
+
hasBasic: !0,
|
| 156 |
+
has256: level >= 2,
|
| 157 |
+
has16m: level >= 3
|
| 158 |
+
}, supportsColor = {
|
| 159 |
+
stdout: colorSupport,
|
| 160 |
+
stderr: colorSupport
|
| 161 |
+
}, browser_default = supportsColor;
|
| 162 |
+
|
| 163 |
+
// ../../../node_modules/vitest-axe/node_modules/chalk/source/utilities.js
|
| 164 |
+
function stringReplaceAll(string, substring, replacer) {
|
| 165 |
+
let index = string.indexOf(substring);
|
| 166 |
+
if (index === -1)
|
| 167 |
+
return string;
|
| 168 |
+
let substringLength = substring.length, endIndex = 0, returnValue = "";
|
| 169 |
+
do
|
| 170 |
+
returnValue += string.slice(endIndex, index) + substring + replacer, endIndex = index + substringLength, index = string.indexOf(substring, endIndex);
|
| 171 |
+
while (index !== -1);
|
| 172 |
+
return returnValue += string.slice(endIndex), returnValue;
|
| 173 |
+
}
|
| 174 |
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
| 175 |
+
let endIndex = 0, returnValue = "";
|
| 176 |
+
do {
|
| 177 |
+
let gotCR = string[index - 1] === "\r";
|
| 178 |
+
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? `\r
|
| 179 |
+
` : `
|
| 180 |
+
`) + postfix, endIndex = index + 1, index = string.indexOf(`
|
| 181 |
+
`, endIndex);
|
| 182 |
+
} while (index !== -1);
|
| 183 |
+
return returnValue += string.slice(endIndex), returnValue;
|
| 184 |
+
}
|
| 185 |
+
|
| 186 |
+
// ../../../node_modules/vitest-axe/node_modules/chalk/source/index.js
|
| 187 |
+
var { stdout: stdoutColor, stderr: stderrColor } = browser_default, GENERATOR = Symbol("GENERATOR"), STYLER = Symbol("STYLER"), IS_EMPTY = Symbol("IS_EMPTY"), levelMapping = [
|
| 188 |
+
"ansi",
|
| 189 |
+
"ansi",
|
| 190 |
+
"ansi256",
|
| 191 |
+
"ansi16m"
|
| 192 |
+
], styles2 = /* @__PURE__ */ Object.create(null), applyOptions = (object, options = {}) => {
|
| 193 |
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3))
|
| 194 |
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
| 195 |
+
let colorLevel = stdoutColor ? stdoutColor.level : 0;
|
| 196 |
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
| 197 |
+
};
|
| 198 |
+
var chalkFactory = (options) => {
|
| 199 |
+
let chalk2 = (...strings) => strings.join(" ");
|
| 200 |
+
return applyOptions(chalk2, options), Object.setPrototypeOf(chalk2, createChalk.prototype), chalk2;
|
| 201 |
+
};
|
| 202 |
+
function createChalk(options) {
|
| 203 |
+
return chalkFactory(options);
|
| 204 |
+
}
|
| 205 |
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
| 206 |
+
for (let [styleName, style] of Object.entries(ansi_styles_default))
|
| 207 |
+
styles2[styleName] = {
|
| 208 |
+
get() {
|
| 209 |
+
let builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
| 210 |
+
return Object.defineProperty(this, styleName, { value: builder }), builder;
|
| 211 |
+
}
|
| 212 |
+
};
|
| 213 |
+
styles2.visible = {
|
| 214 |
+
get() {
|
| 215 |
+
let builder = createBuilder(this, this[STYLER], !0);
|
| 216 |
+
return Object.defineProperty(this, "visible", { value: builder }), builder;
|
| 217 |
+
}
|
| 218 |
+
};
|
| 219 |
+
var getModelAnsi = (model, level2, type, ...arguments_) => model === "rgb" ? level2 === "ansi16m" ? ansi_styles_default[type].ansi16m(...arguments_) : level2 === "ansi256" ? ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)) : ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_)) : model === "hex" ? getModelAnsi("rgb", level2, type, ...ansi_styles_default.hexToRgb(...arguments_)) : ansi_styles_default[type][model](...arguments_), usedModels = ["rgb", "hex", "ansi256"];
|
| 220 |
+
for (let model of usedModels) {
|
| 221 |
+
styles2[model] = {
|
| 222 |
+
get() {
|
| 223 |
+
let { level: level2 } = this;
|
| 224 |
+
return function(...arguments_) {
|
| 225 |
+
let styler = createStyler(getModelAnsi(model, levelMapping[level2], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
| 226 |
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
| 227 |
+
};
|
| 228 |
+
}
|
| 229 |
+
};
|
| 230 |
+
let bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
| 231 |
+
styles2[bgModel] = {
|
| 232 |
+
get() {
|
| 233 |
+
let { level: level2 } = this;
|
| 234 |
+
return function(...arguments_) {
|
| 235 |
+
let styler = createStyler(getModelAnsi(model, levelMapping[level2], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
| 236 |
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
| 237 |
+
};
|
| 238 |
+
}
|
| 239 |
+
};
|
| 240 |
+
}
|
| 241 |
+
var proto = Object.defineProperties(() => {
|
| 242 |
+
}, {
|
| 243 |
+
...styles2,
|
| 244 |
+
level: {
|
| 245 |
+
enumerable: !0,
|
| 246 |
+
get() {
|
| 247 |
+
return this[GENERATOR].level;
|
| 248 |
+
},
|
| 249 |
+
set(level2) {
|
| 250 |
+
this[GENERATOR].level = level2;
|
| 251 |
+
}
|
| 252 |
+
}
|
| 253 |
+
}), createStyler = (open, close, parent) => {
|
| 254 |
+
let openAll, closeAll;
|
| 255 |
+
return parent === void 0 ? (openAll = open, closeAll = close) : (openAll = parent.openAll + open, closeAll = close + parent.closeAll), {
|
| 256 |
+
open,
|
| 257 |
+
close,
|
| 258 |
+
openAll,
|
| 259 |
+
closeAll,
|
| 260 |
+
parent
|
| 261 |
+
};
|
| 262 |
+
}, createBuilder = (self, _styler, _isEmpty) => {
|
| 263 |
+
let builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
| 264 |
+
return Object.setPrototypeOf(builder, proto), builder[GENERATOR] = self, builder[STYLER] = _styler, builder[IS_EMPTY] = _isEmpty, builder;
|
| 265 |
+
}, applyStyle = (self, string) => {
|
| 266 |
+
if (self.level <= 0 || !string)
|
| 267 |
+
return self[IS_EMPTY] ? "" : string;
|
| 268 |
+
let styler = self[STYLER];
|
| 269 |
+
if (styler === void 0)
|
| 270 |
+
return string;
|
| 271 |
+
let { openAll, closeAll } = styler;
|
| 272 |
+
if (string.includes("\x1B"))
|
| 273 |
+
for (; styler !== void 0; )
|
| 274 |
+
string = stringReplaceAll(string, styler.close, styler.open), styler = styler.parent;
|
| 275 |
+
let lfIndex = string.indexOf(`
|
| 276 |
+
`);
|
| 277 |
+
return lfIndex !== -1 && (string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex)), openAll + string + closeAll;
|
| 278 |
+
};
|
| 279 |
+
Object.defineProperties(createChalk.prototype, styles2);
|
| 280 |
+
var chalk = createChalk(), chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
| 281 |
+
var source_default = chalk;
|
| 282 |
+
|
| 283 |
+
// ../../../node_modules/vitest-axe/dist/chunk-X4FZIUYL.js
|
| 284 |
+
var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty, __commonJS = (cb, mod) => function() {
|
| 285 |
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
| 286 |
+
}, __copyProps = (to, from, except, desc) => {
|
| 287 |
+
if (from && typeof from == "object" || typeof from == "function")
|
| 288 |
+
for (let key of __getOwnPropNames(from))
|
| 289 |
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 290 |
+
return to;
|
| 291 |
+
}, __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, mod)), require_ansi_styles = __commonJS({
|
| 292 |
+
"node_modules/pretty-format/node_modules/ansi-styles/index.js"(exports, module) {
|
| 293 |
+
"use strict";
|
| 294 |
+
var ANSI_BACKGROUND_OFFSET = 10, wrapAnsi2562 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`, wrapAnsi16m2 = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
| 295 |
+
function assembleStyles2() {
|
| 296 |
+
let codes = /* @__PURE__ */ new Map(), styles3 = {
|
| 297 |
+
modifier: {
|
| 298 |
+
reset: [0, 0],
|
| 299 |
+
bold: [1, 22],
|
| 300 |
+
dim: [2, 22],
|
| 301 |
+
italic: [3, 23],
|
| 302 |
+
underline: [4, 24],
|
| 303 |
+
overline: [53, 55],
|
| 304 |
+
inverse: [7, 27],
|
| 305 |
+
hidden: [8, 28],
|
| 306 |
+
strikethrough: [9, 29]
|
| 307 |
+
},
|
| 308 |
+
color: {
|
| 309 |
+
black: [30, 39],
|
| 310 |
+
red: [31, 39],
|
| 311 |
+
green: [32, 39],
|
| 312 |
+
yellow: [33, 39],
|
| 313 |
+
blue: [34, 39],
|
| 314 |
+
magenta: [35, 39],
|
| 315 |
+
cyan: [36, 39],
|
| 316 |
+
white: [37, 39],
|
| 317 |
+
blackBright: [90, 39],
|
| 318 |
+
redBright: [91, 39],
|
| 319 |
+
greenBright: [92, 39],
|
| 320 |
+
yellowBright: [93, 39],
|
| 321 |
+
blueBright: [94, 39],
|
| 322 |
+
magentaBright: [95, 39],
|
| 323 |
+
cyanBright: [96, 39],
|
| 324 |
+
whiteBright: [97, 39]
|
| 325 |
+
},
|
| 326 |
+
bgColor: {
|
| 327 |
+
bgBlack: [40, 49],
|
| 328 |
+
bgRed: [41, 49],
|
| 329 |
+
bgGreen: [42, 49],
|
| 330 |
+
bgYellow: [43, 49],
|
| 331 |
+
bgBlue: [44, 49],
|
| 332 |
+
bgMagenta: [45, 49],
|
| 333 |
+
bgCyan: [46, 49],
|
| 334 |
+
bgWhite: [47, 49],
|
| 335 |
+
bgBlackBright: [100, 49],
|
| 336 |
+
bgRedBright: [101, 49],
|
| 337 |
+
bgGreenBright: [102, 49],
|
| 338 |
+
bgYellowBright: [103, 49],
|
| 339 |
+
bgBlueBright: [104, 49],
|
| 340 |
+
bgMagentaBright: [105, 49],
|
| 341 |
+
bgCyanBright: [106, 49],
|
| 342 |
+
bgWhiteBright: [107, 49]
|
| 343 |
+
}
|
| 344 |
+
};
|
| 345 |
+
styles3.color.gray = styles3.color.blackBright, styles3.bgColor.bgGray = styles3.bgColor.bgBlackBright, styles3.color.grey = styles3.color.blackBright, styles3.bgColor.bgGrey = styles3.bgColor.bgBlackBright;
|
| 346 |
+
for (let [groupName, group] of Object.entries(styles3)) {
|
| 347 |
+
for (let [styleName, style] of Object.entries(group))
|
| 348 |
+
styles3[styleName] = {
|
| 349 |
+
open: `\x1B[${style[0]}m`,
|
| 350 |
+
close: `\x1B[${style[1]}m`
|
| 351 |
+
}, group[styleName] = styles3[styleName], codes.set(style[0], style[1]);
|
| 352 |
+
Object.defineProperty(styles3, groupName, {
|
| 353 |
+
value: group,
|
| 354 |
+
enumerable: !1
|
| 355 |
+
});
|
| 356 |
+
}
|
| 357 |
+
return Object.defineProperty(styles3, "codes", {
|
| 358 |
+
value: codes,
|
| 359 |
+
enumerable: !1
|
| 360 |
+
}), styles3.color.close = "\x1B[39m", styles3.bgColor.close = "\x1B[49m", styles3.color.ansi256 = wrapAnsi2562(), styles3.color.ansi16m = wrapAnsi16m2(), styles3.bgColor.ansi256 = wrapAnsi2562(ANSI_BACKGROUND_OFFSET), styles3.bgColor.ansi16m = wrapAnsi16m2(ANSI_BACKGROUND_OFFSET), Object.defineProperties(styles3, {
|
| 361 |
+
rgbToAnsi256: {
|
| 362 |
+
value: (red, green, blue) => red === green && green === blue ? red < 8 ? 16 : red > 248 ? 231 : Math.round((red - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5),
|
| 363 |
+
enumerable: !1
|
| 364 |
+
},
|
| 365 |
+
hexToRgb: {
|
| 366 |
+
value: (hex) => {
|
| 367 |
+
let matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
|
| 368 |
+
if (!matches)
|
| 369 |
+
return [0, 0, 0];
|
| 370 |
+
let { colorString } = matches.groups;
|
| 371 |
+
colorString.length === 3 && (colorString = colorString.split("").map((character) => character + character).join(""));
|
| 372 |
+
let integer = Number.parseInt(colorString, 16);
|
| 373 |
+
return [
|
| 374 |
+
integer >> 16 & 255,
|
| 375 |
+
integer >> 8 & 255,
|
| 376 |
+
integer & 255
|
| 377 |
+
];
|
| 378 |
+
},
|
| 379 |
+
enumerable: !1
|
| 380 |
+
},
|
| 381 |
+
hexToAnsi256: {
|
| 382 |
+
value: (hex) => styles3.rgbToAnsi256(...styles3.hexToRgb(hex)),
|
| 383 |
+
enumerable: !1
|
| 384 |
+
}
|
| 385 |
+
}), styles3;
|
| 386 |
+
}
|
| 387 |
+
Object.defineProperty(module, "exports", {
|
| 388 |
+
enumerable: !0,
|
| 389 |
+
get: assembleStyles2
|
| 390 |
+
});
|
| 391 |
+
}
|
| 392 |
+
}), require_collections = __commonJS({
|
| 393 |
+
"node_modules/pretty-format/build/collections.js"(exports) {
|
| 394 |
+
"use strict";
|
| 395 |
+
Object.defineProperty(exports, "__esModule", {
|
| 396 |
+
value: !0
|
| 397 |
+
}), exports.printIteratorEntries = printIteratorEntries, exports.printIteratorValues = printIteratorValues, exports.printListItems = printListItems, exports.printObjectProperties = printObjectProperties;
|
| 398 |
+
var getKeysOfEnumerableProperties = (object, compareKeys) => {
|
| 399 |
+
let keys = Object.keys(object).sort(compareKeys);
|
| 400 |
+
return Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(object).forEach((symbol) => {
|
| 401 |
+
Object.getOwnPropertyDescriptor(object, symbol).enumerable && keys.push(symbol);
|
| 402 |
+
}), keys;
|
| 403 |
+
};
|
| 404 |
+
function printIteratorEntries(iterator, config, indentation, depth, refs, printer, separator = ": ") {
|
| 405 |
+
let result = "", width = 0, current = iterator.next();
|
| 406 |
+
if (!current.done) {
|
| 407 |
+
result += config.spacingOuter;
|
| 408 |
+
let indentationNext = indentation + config.indent;
|
| 409 |
+
for (; !current.done; ) {
|
| 410 |
+
if (result += indentationNext, width++ === config.maxWidth) {
|
| 411 |
+
result += "\u2026";
|
| 412 |
+
break;
|
| 413 |
+
}
|
| 414 |
+
let name = printer(current.value[0], config, indentationNext, depth, refs), value = printer(current.value[1], config, indentationNext, depth, refs);
|
| 415 |
+
result += name + separator + value, current = iterator.next(), current.done ? config.min || (result += ",") : result += `,${config.spacingInner}`;
|
| 416 |
+
}
|
| 417 |
+
result += config.spacingOuter + indentation;
|
| 418 |
+
}
|
| 419 |
+
return result;
|
| 420 |
+
}
|
| 421 |
+
function printIteratorValues(iterator, config, indentation, depth, refs, printer) {
|
| 422 |
+
let result = "", width = 0, current = iterator.next();
|
| 423 |
+
if (!current.done) {
|
| 424 |
+
result += config.spacingOuter;
|
| 425 |
+
let indentationNext = indentation + config.indent;
|
| 426 |
+
for (; !current.done; ) {
|
| 427 |
+
if (result += indentationNext, width++ === config.maxWidth) {
|
| 428 |
+
result += "\u2026";
|
| 429 |
+
break;
|
| 430 |
+
}
|
| 431 |
+
result += printer(current.value, config, indentationNext, depth, refs), current = iterator.next(), current.done ? config.min || (result += ",") : result += `,${config.spacingInner}`;
|
| 432 |
+
}
|
| 433 |
+
result += config.spacingOuter + indentation;
|
| 434 |
+
}
|
| 435 |
+
return result;
|
| 436 |
+
}
|
| 437 |
+
function printListItems(list, config, indentation, depth, refs, printer) {
|
| 438 |
+
let result = "";
|
| 439 |
+
if (list.length) {
|
| 440 |
+
result += config.spacingOuter;
|
| 441 |
+
let indentationNext = indentation + config.indent;
|
| 442 |
+
for (let i = 0; i < list.length; i++) {
|
| 443 |
+
if (result += indentationNext, i === config.maxWidth) {
|
| 444 |
+
result += "\u2026";
|
| 445 |
+
break;
|
| 446 |
+
}
|
| 447 |
+
i in list && (result += printer(list[i], config, indentationNext, depth, refs)), i < list.length - 1 ? result += `,${config.spacingInner}` : config.min || (result += ",");
|
| 448 |
+
}
|
| 449 |
+
result += config.spacingOuter + indentation;
|
| 450 |
+
}
|
| 451 |
+
return result;
|
| 452 |
+
}
|
| 453 |
+
function printObjectProperties(val, config, indentation, depth, refs, printer) {
|
| 454 |
+
let result = "", keys = getKeysOfEnumerableProperties(val, config.compareKeys);
|
| 455 |
+
if (keys.length) {
|
| 456 |
+
result += config.spacingOuter;
|
| 457 |
+
let indentationNext = indentation + config.indent;
|
| 458 |
+
for (let i = 0; i < keys.length; i++) {
|
| 459 |
+
let key = keys[i], name = printer(key, config, indentationNext, depth, refs), value = printer(val[key], config, indentationNext, depth, refs);
|
| 460 |
+
result += `${indentationNext + name}: ${value}`, i < keys.length - 1 ? result += `,${config.spacingInner}` : config.min || (result += ",");
|
| 461 |
+
}
|
| 462 |
+
result += config.spacingOuter + indentation;
|
| 463 |
+
}
|
| 464 |
+
return result;
|
| 465 |
+
}
|
| 466 |
+
}
|
| 467 |
+
}), require_AsymmetricMatcher = __commonJS({
|
| 468 |
+
"node_modules/pretty-format/build/plugins/AsymmetricMatcher.js"(exports) {
|
| 469 |
+
"use strict";
|
| 470 |
+
Object.defineProperty(exports, "__esModule", {
|
| 471 |
+
value: !0
|
| 472 |
+
}), exports.test = exports.serialize = exports.default = void 0;
|
| 473 |
+
var _collections = require_collections(), Symbol2 = globalThis["jest-symbol-do-not-touch"] || globalThis.Symbol, asymmetricMatcher = typeof Symbol2 == "function" && Symbol2.for ? Symbol2.for("jest.asymmetricMatcher") : 1267621, SPACE = " ", serialize = (val, config, indentation, depth, refs, printer) => {
|
| 474 |
+
let stringedValue = val.toString();
|
| 475 |
+
if (stringedValue === "ArrayContaining" || stringedValue === "ArrayNotContaining")
|
| 476 |
+
return ++depth > config.maxDepth ? `[${stringedValue}]` : `${stringedValue + SPACE}[${(0, _collections.printListItems)(val.sample, config, indentation, depth, refs, printer)}]`;
|
| 477 |
+
if (stringedValue === "ObjectContaining" || stringedValue === "ObjectNotContaining")
|
| 478 |
+
return ++depth > config.maxDepth ? `[${stringedValue}]` : `${stringedValue + SPACE}{${(0, _collections.printObjectProperties)(val.sample, config, indentation, depth, refs, printer)}}`;
|
| 479 |
+
if (stringedValue === "StringMatching" || stringedValue === "StringNotMatching" || stringedValue === "StringContaining" || stringedValue === "StringNotContaining")
|
| 480 |
+
return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
|
| 481 |
+
if (typeof val.toAsymmetricMatcher != "function")
|
| 482 |
+
throw new Error(`Asymmetric matcher ${val.constructor.name} does not implement toAsymmetricMatcher()`);
|
| 483 |
+
return val.toAsymmetricMatcher();
|
| 484 |
+
};
|
| 485 |
+
exports.serialize = serialize;
|
| 486 |
+
var test = (val) => val && val.$$typeof === asymmetricMatcher;
|
| 487 |
+
exports.test = test;
|
| 488 |
+
var plugin = {
|
| 489 |
+
serialize,
|
| 490 |
+
test
|
| 491 |
+
}, _default = plugin;
|
| 492 |
+
exports.default = _default;
|
| 493 |
+
}
|
| 494 |
+
}), require_ansi_regex = __commonJS({
|
| 495 |
+
"node_modules/ansi-regex/index.js"(exports, module) {
|
| 496 |
+
"use strict";
|
| 497 |
+
module.exports = ({ onlyFirst = !1 } = {}) => {
|
| 498 |
+
let pattern = [
|
| 499 |
+
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
| 500 |
+
"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
|
| 501 |
+
].join("|");
|
| 502 |
+
return new RegExp(pattern, onlyFirst ? void 0 : "g");
|
| 503 |
+
};
|
| 504 |
+
}
|
| 505 |
+
}), require_ConvertAnsi = __commonJS({
|
| 506 |
+
"node_modules/pretty-format/build/plugins/ConvertAnsi.js"(exports) {
|
| 507 |
+
"use strict";
|
| 508 |
+
Object.defineProperty(exports, "__esModule", {
|
| 509 |
+
value: !0
|
| 510 |
+
}), exports.test = exports.serialize = exports.default = void 0;
|
| 511 |
+
var _ansiRegex = _interopRequireDefault(require_ansi_regex()), _ansiStyles = _interopRequireDefault(require_ansi_styles());
|
| 512 |
+
function _interopRequireDefault(obj) {
|
| 513 |
+
return obj && obj.__esModule ? obj : { default: obj };
|
| 514 |
+
}
|
| 515 |
+
var toHumanReadableAnsi = (text) => text.replace((0, _ansiRegex.default)(), (match) => {
|
| 516 |
+
switch (match) {
|
| 517 |
+
case _ansiStyles.default.red.close:
|
| 518 |
+
case _ansiStyles.default.green.close:
|
| 519 |
+
case _ansiStyles.default.cyan.close:
|
| 520 |
+
case _ansiStyles.default.gray.close:
|
| 521 |
+
case _ansiStyles.default.white.close:
|
| 522 |
+
case _ansiStyles.default.yellow.close:
|
| 523 |
+
case _ansiStyles.default.bgRed.close:
|
| 524 |
+
case _ansiStyles.default.bgGreen.close:
|
| 525 |
+
case _ansiStyles.default.bgYellow.close:
|
| 526 |
+
case _ansiStyles.default.inverse.close:
|
| 527 |
+
case _ansiStyles.default.dim.close:
|
| 528 |
+
case _ansiStyles.default.bold.close:
|
| 529 |
+
case _ansiStyles.default.reset.open:
|
| 530 |
+
case _ansiStyles.default.reset.close:
|
| 531 |
+
return "</>";
|
| 532 |
+
case _ansiStyles.default.red.open:
|
| 533 |
+
return "<red>";
|
| 534 |
+
case _ansiStyles.default.green.open:
|
| 535 |
+
return "<green>";
|
| 536 |
+
case _ansiStyles.default.cyan.open:
|
| 537 |
+
return "<cyan>";
|
| 538 |
+
case _ansiStyles.default.gray.open:
|
| 539 |
+
return "<gray>";
|
| 540 |
+
case _ansiStyles.default.white.open:
|
| 541 |
+
return "<white>";
|
| 542 |
+
case _ansiStyles.default.yellow.open:
|
| 543 |
+
return "<yellow>";
|
| 544 |
+
case _ansiStyles.default.bgRed.open:
|
| 545 |
+
return "<bgRed>";
|
| 546 |
+
case _ansiStyles.default.bgGreen.open:
|
| 547 |
+
return "<bgGreen>";
|
| 548 |
+
case _ansiStyles.default.bgYellow.open:
|
| 549 |
+
return "<bgYellow>";
|
| 550 |
+
case _ansiStyles.default.inverse.open:
|
| 551 |
+
return "<inverse>";
|
| 552 |
+
case _ansiStyles.default.dim.open:
|
| 553 |
+
return "<dim>";
|
| 554 |
+
case _ansiStyles.default.bold.open:
|
| 555 |
+
return "<bold>";
|
| 556 |
+
default:
|
| 557 |
+
return "";
|
| 558 |
+
}
|
| 559 |
+
}), test = (val) => typeof val == "string" && !!val.match((0, _ansiRegex.default)());
|
| 560 |
+
exports.test = test;
|
| 561 |
+
var serialize = (val, config, indentation, depth, refs, printer) => printer(toHumanReadableAnsi(val), config, indentation, depth, refs);
|
| 562 |
+
exports.serialize = serialize;
|
| 563 |
+
var plugin = {
|
| 564 |
+
serialize,
|
| 565 |
+
test
|
| 566 |
+
}, _default = plugin;
|
| 567 |
+
exports.default = _default;
|
| 568 |
+
}
|
| 569 |
+
}), require_DOMCollection = __commonJS({
|
| 570 |
+
"node_modules/pretty-format/build/plugins/DOMCollection.js"(exports) {
|
| 571 |
+
"use strict";
|
| 572 |
+
Object.defineProperty(exports, "__esModule", {
|
| 573 |
+
value: !0
|
| 574 |
+
}), exports.test = exports.serialize = exports.default = void 0;
|
| 575 |
+
var _collections = require_collections(), SPACE = " ", OBJECT_NAMES = ["DOMStringMap", "NamedNodeMap"], ARRAY_REGEXP = /^(HTML\w*Collection|NodeList)$/, testName = (name) => OBJECT_NAMES.indexOf(name) !== -1 || ARRAY_REGEXP.test(name), test = (val) => val && val.constructor && !!val.constructor.name && testName(val.constructor.name);
|
| 576 |
+
exports.test = test;
|
| 577 |
+
var isNamedNodeMap = (collection) => collection.constructor.name === "NamedNodeMap", serialize = (collection, config, indentation, depth, refs, printer) => {
|
| 578 |
+
let name = collection.constructor.name;
|
| 579 |
+
return ++depth > config.maxDepth ? `[${name}]` : (config.min ? "" : name + SPACE) + (OBJECT_NAMES.indexOf(name) !== -1 ? `{${(0, _collections.printObjectProperties)(isNamedNodeMap(collection) ? Array.from(collection).reduce((props, attribute) => (props[attribute.name] = attribute.value, props), {}) : { ...collection }, config, indentation, depth, refs, printer)}}` : `[${(0, _collections.printListItems)(Array.from(collection), config, indentation, depth, refs, printer)}]`);
|
| 580 |
+
};
|
| 581 |
+
exports.serialize = serialize;
|
| 582 |
+
var plugin = {
|
| 583 |
+
serialize,
|
| 584 |
+
test
|
| 585 |
+
}, _default = plugin;
|
| 586 |
+
exports.default = _default;
|
| 587 |
+
}
|
| 588 |
+
}), require_escapeHTML = __commonJS({
|
| 589 |
+
"node_modules/pretty-format/build/plugins/lib/escapeHTML.js"(exports) {
|
| 590 |
+
"use strict";
|
| 591 |
+
Object.defineProperty(exports, "__esModule", {
|
| 592 |
+
value: !0
|
| 593 |
+
}), exports.default = escapeHTML;
|
| 594 |
+
function escapeHTML(str) {
|
| 595 |
+
return str.replace(/</g, "<").replace(/>/g, ">");
|
| 596 |
+
}
|
| 597 |
+
}
|
| 598 |
+
}), require_markup = __commonJS({
|
| 599 |
+
"node_modules/pretty-format/build/plugins/lib/markup.js"(exports) {
|
| 600 |
+
"use strict";
|
| 601 |
+
Object.defineProperty(exports, "__esModule", {
|
| 602 |
+
value: !0
|
| 603 |
+
}), exports.printText = exports.printProps = exports.printElementAsLeaf = exports.printElement = exports.printComment = exports.printChildren = void 0;
|
| 604 |
+
var _escapeHTML = _interopRequireDefault(require_escapeHTML());
|
| 605 |
+
function _interopRequireDefault(obj) {
|
| 606 |
+
return obj && obj.__esModule ? obj : { default: obj };
|
| 607 |
+
}
|
| 608 |
+
var printProps = (keys, props, config, indentation, depth, refs, printer) => {
|
| 609 |
+
let indentationNext = indentation + config.indent, colors = config.colors;
|
| 610 |
+
return keys.map((key) => {
|
| 611 |
+
let value = props[key], printed = printer(value, config, indentationNext, depth, refs);
|
| 612 |
+
return typeof value != "string" && (printed.indexOf(`
|
| 613 |
+
`) !== -1 && (printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation), printed = `{${printed}}`), `${config.spacingInner + indentation + colors.prop.open + key + colors.prop.close}=${colors.value.open}${printed}${colors.value.close}`;
|
| 614 |
+
}).join("");
|
| 615 |
+
};
|
| 616 |
+
exports.printProps = printProps;
|
| 617 |
+
var printChildren = (children, config, indentation, depth, refs, printer) => children.map((child) => config.spacingOuter + indentation + (typeof child == "string" ? printText(child, config) : printer(child, config, indentation, depth, refs))).join("");
|
| 618 |
+
exports.printChildren = printChildren;
|
| 619 |
+
var printText = (text, config) => {
|
| 620 |
+
let contentColor = config.colors.content;
|
| 621 |
+
return contentColor.open + (0, _escapeHTML.default)(text) + contentColor.close;
|
| 622 |
+
};
|
| 623 |
+
exports.printText = printText;
|
| 624 |
+
var printComment = (comment, config) => {
|
| 625 |
+
let commentColor = config.colors.comment;
|
| 626 |
+
return `${commentColor.open}<!--${(0, _escapeHTML.default)(comment)}-->${commentColor.close}`;
|
| 627 |
+
};
|
| 628 |
+
exports.printComment = printComment;
|
| 629 |
+
var printElement = (type, printedProps, printedChildren, config, indentation) => {
|
| 630 |
+
let tagColor = config.colors.tag;
|
| 631 |
+
return `${tagColor.open}<${type}${printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open}${printedChildren ? `>${tagColor.close}${printedChildren}${config.spacingOuter}${indentation}${tagColor.open}</${type}` : `${printedProps && !config.min ? "" : " "}/`}>${tagColor.close}`;
|
| 632 |
+
};
|
| 633 |
+
exports.printElement = printElement;
|
| 634 |
+
var printElementAsLeaf = (type, config) => {
|
| 635 |
+
let tagColor = config.colors.tag;
|
| 636 |
+
return `${tagColor.open}<${type}${tagColor.close} \u2026${tagColor.open} />${tagColor.close}`;
|
| 637 |
+
};
|
| 638 |
+
exports.printElementAsLeaf = printElementAsLeaf;
|
| 639 |
+
}
|
| 640 |
+
}), require_DOMElement = __commonJS({
|
| 641 |
+
"node_modules/pretty-format/build/plugins/DOMElement.js"(exports) {
|
| 642 |
+
"use strict";
|
| 643 |
+
Object.defineProperty(exports, "__esModule", {
|
| 644 |
+
value: !0
|
| 645 |
+
}), exports.test = exports.serialize = exports.default = void 0;
|
| 646 |
+
var _markup = require_markup(), ELEMENT_NODE = 1, TEXT_NODE = 3, COMMENT_NODE = 8, FRAGMENT_NODE = 11, ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/, testHasAttribute = (val) => {
|
| 647 |
+
try {
|
| 648 |
+
return typeof val.hasAttribute == "function" && val.hasAttribute("is");
|
| 649 |
+
} catch {
|
| 650 |
+
return !1;
|
| 651 |
+
}
|
| 652 |
+
}, testNode = (val) => {
|
| 653 |
+
let constructorName = val.constructor.name, { nodeType, tagName } = val, isCustomElement = typeof tagName == "string" && tagName.includes("-") || testHasAttribute(val);
|
| 654 |
+
return nodeType === ELEMENT_NODE && (ELEMENT_REGEXP.test(constructorName) || isCustomElement) || nodeType === TEXT_NODE && constructorName === "Text" || nodeType === COMMENT_NODE && constructorName === "Comment" || nodeType === FRAGMENT_NODE && constructorName === "DocumentFragment";
|
| 655 |
+
}, test = (val) => {
|
| 656 |
+
var _val$constructor;
|
| 657 |
+
return (val == null || (_val$constructor = val.constructor) === null || _val$constructor === void 0 ? void 0 : _val$constructor.name) && testNode(val);
|
| 658 |
+
};
|
| 659 |
+
exports.test = test;
|
| 660 |
+
function nodeIsText(node) {
|
| 661 |
+
return node.nodeType === TEXT_NODE;
|
| 662 |
+
}
|
| 663 |
+
function nodeIsComment(node) {
|
| 664 |
+
return node.nodeType === COMMENT_NODE;
|
| 665 |
+
}
|
| 666 |
+
function nodeIsFragment(node) {
|
| 667 |
+
return node.nodeType === FRAGMENT_NODE;
|
| 668 |
+
}
|
| 669 |
+
var serialize = (node, config, indentation, depth, refs, printer) => {
|
| 670 |
+
if (nodeIsText(node))
|
| 671 |
+
return (0, _markup.printText)(node.data, config);
|
| 672 |
+
if (nodeIsComment(node))
|
| 673 |
+
return (0, _markup.printComment)(node.data, config);
|
| 674 |
+
let type = nodeIsFragment(node) ? "DocumentFragment" : node.tagName.toLowerCase();
|
| 675 |
+
return ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(type, config) : (0, _markup.printElement)(type, (0, _markup.printProps)(nodeIsFragment(node) ? [] : Array.from(node.attributes).map((attr) => attr.name).sort(), nodeIsFragment(node) ? {} : Array.from(node.attributes).reduce((props, attribute) => (props[attribute.name] = attribute.value, props), {}), config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
|
| 676 |
+
};
|
| 677 |
+
exports.serialize = serialize;
|
| 678 |
+
var plugin = {
|
| 679 |
+
serialize,
|
| 680 |
+
test
|
| 681 |
+
}, _default = plugin;
|
| 682 |
+
exports.default = _default;
|
| 683 |
+
}
|
| 684 |
+
}), require_Immutable = __commonJS({
|
| 685 |
+
"node_modules/pretty-format/build/plugins/Immutable.js"(exports) {
|
| 686 |
+
"use strict";
|
| 687 |
+
Object.defineProperty(exports, "__esModule", {
|
| 688 |
+
value: !0
|
| 689 |
+
}), exports.test = exports.serialize = exports.default = void 0;
|
| 690 |
+
var _collections = require_collections(), IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@", IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@", IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@", IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@", IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@", IS_RECORD_SENTINEL = "@@__IMMUTABLE_RECORD__@@", IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@", IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@", IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@", getImmutableName = (name) => `Immutable.${name}`, printAsLeaf = (name) => `[${name}]`, SPACE = " ", LAZY = "\u2026", printImmutableEntries = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}{${(0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer)}}`;
|
| 691 |
+
function getRecordEntries(val) {
|
| 692 |
+
let i = 0;
|
| 693 |
+
return {
|
| 694 |
+
next() {
|
| 695 |
+
if (i < val._keys.length) {
|
| 696 |
+
let key = val._keys[i++];
|
| 697 |
+
return {
|
| 698 |
+
done: !1,
|
| 699 |
+
value: [key, val.get(key)]
|
| 700 |
+
};
|
| 701 |
+
}
|
| 702 |
+
return {
|
| 703 |
+
done: !0,
|
| 704 |
+
value: void 0
|
| 705 |
+
};
|
| 706 |
+
}
|
| 707 |
+
};
|
| 708 |
+
}
|
| 709 |
+
var printImmutableRecord = (val, config, indentation, depth, refs, printer) => {
|
| 710 |
+
let name = getImmutableName(val._name || "Record");
|
| 711 |
+
return ++depth > config.maxDepth ? printAsLeaf(name) : `${name + SPACE}{${(0, _collections.printIteratorEntries)(getRecordEntries(val), config, indentation, depth, refs, printer)}}`;
|
| 712 |
+
}, printImmutableSeq = (val, config, indentation, depth, refs, printer) => {
|
| 713 |
+
let name = getImmutableName("Seq");
|
| 714 |
+
return ++depth > config.maxDepth ? printAsLeaf(name) : val[IS_KEYED_SENTINEL] ? `${name + SPACE}{${val._iter || val._object ? (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) : LAZY}}` : `${name + SPACE}[${val._iter || val._array || val._collection || val._iterable ? (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) : LAZY}]`;
|
| 715 |
+
}, printImmutableValues = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}[${(0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer)}]`, serialize = (val, config, indentation, depth, refs, printer) => val[IS_MAP_SENTINEL] ? printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedMap" : "Map") : val[IS_LIST_SENTINEL] ? printImmutableValues(val, config, indentation, depth, refs, printer, "List") : val[IS_SET_SENTINEL] ? printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedSet" : "Set") : val[IS_STACK_SENTINEL] ? printImmutableValues(val, config, indentation, depth, refs, printer, "Stack") : val[IS_SEQ_SENTINEL] ? printImmutableSeq(val, config, indentation, depth, refs, printer) : printImmutableRecord(val, config, indentation, depth, refs, printer);
|
| 716 |
+
exports.serialize = serialize;
|
| 717 |
+
var test = (val) => val && (val[IS_ITERABLE_SENTINEL] === !0 || val[IS_RECORD_SENTINEL] === !0);
|
| 718 |
+
exports.test = test;
|
| 719 |
+
var plugin = {
|
| 720 |
+
serialize,
|
| 721 |
+
test
|
| 722 |
+
}, _default = plugin;
|
| 723 |
+
exports.default = _default;
|
| 724 |
+
}
|
| 725 |
+
}), require_react_is_production_min = __commonJS({
|
| 726 |
+
"node_modules/react-is/cjs/react-is.production.min.js"(exports) {
|
| 727 |
+
"use strict";
|
| 728 |
+
var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u;
|
| 729 |
+
u = Symbol.for("react.module.reference");
|
| 730 |
+
function v(a) {
|
| 731 |
+
if (typeof a == "object" && a !== null) {
|
| 732 |
+
var r = a.$$typeof;
|
| 733 |
+
switch (r) {
|
| 734 |
+
case b:
|
| 735 |
+
switch (a = a.type, a) {
|
| 736 |
+
case d:
|
| 737 |
+
case f:
|
| 738 |
+
case e:
|
| 739 |
+
case m:
|
| 740 |
+
case n:
|
| 741 |
+
return a;
|
| 742 |
+
default:
|
| 743 |
+
switch (a = a && a.$$typeof, a) {
|
| 744 |
+
case k:
|
| 745 |
+
case h:
|
| 746 |
+
case l:
|
| 747 |
+
case q:
|
| 748 |
+
case p:
|
| 749 |
+
case g:
|
| 750 |
+
return a;
|
| 751 |
+
default:
|
| 752 |
+
return r;
|
| 753 |
+
}
|
| 754 |
+
}
|
| 755 |
+
case c:
|
| 756 |
+
return r;
|
| 757 |
+
}
|
| 758 |
+
}
|
| 759 |
+
}
|
| 760 |
+
exports.ContextConsumer = h, exports.ContextProvider = g, exports.Element = b, exports.ForwardRef = l, exports.Fragment = d, exports.Lazy = q, exports.Memo = p, exports.Portal = c, exports.Profiler = f, exports.StrictMode = e, exports.Suspense = m, exports.SuspenseList = n, exports.isAsyncMode = function() {
|
| 761 |
+
return !1;
|
| 762 |
+
}, exports.isConcurrentMode = function() {
|
| 763 |
+
return !1;
|
| 764 |
+
}, exports.isContextConsumer = function(a) {
|
| 765 |
+
return v(a) === h;
|
| 766 |
+
}, exports.isContextProvider = function(a) {
|
| 767 |
+
return v(a) === g;
|
| 768 |
+
}, exports.isElement = function(a) {
|
| 769 |
+
return typeof a == "object" && a !== null && a.$$typeof === b;
|
| 770 |
+
}, exports.isForwardRef = function(a) {
|
| 771 |
+
return v(a) === l;
|
| 772 |
+
}, exports.isFragment = function(a) {
|
| 773 |
+
return v(a) === d;
|
| 774 |
+
}, exports.isLazy = function(a) {
|
| 775 |
+
return v(a) === q;
|
| 776 |
+
}, exports.isMemo = function(a) {
|
| 777 |
+
return v(a) === p;
|
| 778 |
+
}, exports.isPortal = function(a) {
|
| 779 |
+
return v(a) === c;
|
| 780 |
+
}, exports.isProfiler = function(a) {
|
| 781 |
+
return v(a) === f;
|
| 782 |
+
}, exports.isStrictMode = function(a) {
|
| 783 |
+
return v(a) === e;
|
| 784 |
+
}, exports.isSuspense = function(a) {
|
| 785 |
+
return v(a) === m;
|
| 786 |
+
}, exports.isSuspenseList = function(a) {
|
| 787 |
+
return v(a) === n;
|
| 788 |
+
}, exports.isValidElementType = function(a) {
|
| 789 |
+
return typeof a == "string" || typeof a == "function" || a === d || a === f || a === e || a === m || a === n || a === t || typeof a == "object" && a !== null && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || a.getModuleId !== void 0);
|
| 790 |
+
}, exports.typeOf = v;
|
| 791 |
+
}
|
| 792 |
+
}), require_react_is_development = __commonJS({
|
| 793 |
+
"node_modules/react-is/cjs/react-is.development.js"(exports) {
|
| 794 |
+
"use strict";
|
| 795 |
+
process.env.NODE_ENV !== "production" && (function() {
|
| 796 |
+
"use strict";
|
| 797 |
+
var REACT_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), enableScopeAPI = !1, enableCacheElement = !1, enableTransitionTracing = !1, enableLegacyHidden = !1, enableDebugTracing = !1, REACT_MODULE_REFERENCE;
|
| 798 |
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
| 799 |
+
function isValidElementType(type) {
|
| 800 |
+
return !!(typeof type == "string" || typeof type == "function" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0));
|
| 801 |
+
}
|
| 802 |
+
function typeOf(object) {
|
| 803 |
+
if (typeof object == "object" && object !== null) {
|
| 804 |
+
var $$typeof = object.$$typeof;
|
| 805 |
+
switch ($$typeof) {
|
| 806 |
+
case REACT_ELEMENT_TYPE:
|
| 807 |
+
var type = object.type;
|
| 808 |
+
switch (type) {
|
| 809 |
+
case REACT_FRAGMENT_TYPE:
|
| 810 |
+
case REACT_PROFILER_TYPE:
|
| 811 |
+
case REACT_STRICT_MODE_TYPE:
|
| 812 |
+
case REACT_SUSPENSE_TYPE:
|
| 813 |
+
case REACT_SUSPENSE_LIST_TYPE:
|
| 814 |
+
return type;
|
| 815 |
+
default:
|
| 816 |
+
var $$typeofType = type && type.$$typeof;
|
| 817 |
+
switch ($$typeofType) {
|
| 818 |
+
case REACT_SERVER_CONTEXT_TYPE:
|
| 819 |
+
case REACT_CONTEXT_TYPE:
|
| 820 |
+
case REACT_FORWARD_REF_TYPE:
|
| 821 |
+
case REACT_LAZY_TYPE:
|
| 822 |
+
case REACT_MEMO_TYPE:
|
| 823 |
+
case REACT_PROVIDER_TYPE:
|
| 824 |
+
return $$typeofType;
|
| 825 |
+
default:
|
| 826 |
+
return $$typeof;
|
| 827 |
+
}
|
| 828 |
+
}
|
| 829 |
+
case REACT_PORTAL_TYPE:
|
| 830 |
+
return $$typeof;
|
| 831 |
+
}
|
| 832 |
+
}
|
| 833 |
+
}
|
| 834 |
+
var ContextConsumer = REACT_CONTEXT_TYPE, ContextProvider = REACT_PROVIDER_TYPE, Element = REACT_ELEMENT_TYPE, ForwardRef = REACT_FORWARD_REF_TYPE, Fragment = REACT_FRAGMENT_TYPE, Lazy = REACT_LAZY_TYPE, Memo = REACT_MEMO_TYPE, Portal = REACT_PORTAL_TYPE, Profiler = REACT_PROFILER_TYPE, StrictMode = REACT_STRICT_MODE_TYPE, Suspense = REACT_SUSPENSE_TYPE, SuspenseList = REACT_SUSPENSE_LIST_TYPE, hasWarnedAboutDeprecatedIsAsyncMode = !1, hasWarnedAboutDeprecatedIsConcurrentMode = !1;
|
| 835 |
+
function isAsyncMode(object) {
|
| 836 |
+
return hasWarnedAboutDeprecatedIsAsyncMode || (hasWarnedAboutDeprecatedIsAsyncMode = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")), !1;
|
| 837 |
+
}
|
| 838 |
+
function isConcurrentMode(object) {
|
| 839 |
+
return hasWarnedAboutDeprecatedIsConcurrentMode || (hasWarnedAboutDeprecatedIsConcurrentMode = !0, console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")), !1;
|
| 840 |
+
}
|
| 841 |
+
function isContextConsumer(object) {
|
| 842 |
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
| 843 |
+
}
|
| 844 |
+
function isContextProvider(object) {
|
| 845 |
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
| 846 |
+
}
|
| 847 |
+
function isElement(object) {
|
| 848 |
+
return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
| 849 |
+
}
|
| 850 |
+
function isForwardRef(object) {
|
| 851 |
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
| 852 |
+
}
|
| 853 |
+
function isFragment(object) {
|
| 854 |
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
| 855 |
+
}
|
| 856 |
+
function isLazy(object) {
|
| 857 |
+
return typeOf(object) === REACT_LAZY_TYPE;
|
| 858 |
+
}
|
| 859 |
+
function isMemo(object) {
|
| 860 |
+
return typeOf(object) === REACT_MEMO_TYPE;
|
| 861 |
+
}
|
| 862 |
+
function isPortal(object) {
|
| 863 |
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
| 864 |
+
}
|
| 865 |
+
function isProfiler(object) {
|
| 866 |
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
| 867 |
+
}
|
| 868 |
+
function isStrictMode(object) {
|
| 869 |
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
| 870 |
+
}
|
| 871 |
+
function isSuspense(object) {
|
| 872 |
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
| 873 |
+
}
|
| 874 |
+
function isSuspenseList(object) {
|
| 875 |
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
| 876 |
+
}
|
| 877 |
+
exports.ContextConsumer = ContextConsumer, exports.ContextProvider = ContextProvider, exports.Element = Element, exports.ForwardRef = ForwardRef, exports.Fragment = Fragment, exports.Lazy = Lazy, exports.Memo = Memo, exports.Portal = Portal, exports.Profiler = Profiler, exports.StrictMode = StrictMode, exports.Suspense = Suspense, exports.SuspenseList = SuspenseList, exports.isAsyncMode = isAsyncMode, exports.isConcurrentMode = isConcurrentMode, exports.isContextConsumer = isContextConsumer, exports.isContextProvider = isContextProvider, exports.isElement = isElement, exports.isForwardRef = isForwardRef, exports.isFragment = isFragment, exports.isLazy = isLazy, exports.isMemo = isMemo, exports.isPortal = isPortal, exports.isProfiler = isProfiler, exports.isStrictMode = isStrictMode, exports.isSuspense = isSuspense, exports.isSuspenseList = isSuspenseList, exports.isValidElementType = isValidElementType, exports.typeOf = typeOf;
|
| 878 |
+
})();
|
| 879 |
+
}
|
| 880 |
+
}), require_react_is = __commonJS({
|
| 881 |
+
"node_modules/react-is/index.js"(exports, module) {
|
| 882 |
+
"use strict";
|
| 883 |
+
process.env.NODE_ENV === "production" ? module.exports = require_react_is_production_min() : module.exports = require_react_is_development();
|
| 884 |
+
}
|
| 885 |
+
}), require_ReactElement = __commonJS({
|
| 886 |
+
"node_modules/pretty-format/build/plugins/ReactElement.js"(exports) {
|
| 887 |
+
"use strict";
|
| 888 |
+
Object.defineProperty(exports, "__esModule", {
|
| 889 |
+
value: !0
|
| 890 |
+
}), exports.test = exports.serialize = exports.default = void 0;
|
| 891 |
+
var ReactIs = _interopRequireWildcard(require_react_is()), _markup = require_markup();
|
| 892 |
+
function _getRequireWildcardCache(nodeInterop) {
|
| 893 |
+
if (typeof WeakMap != "function")
|
| 894 |
+
return null;
|
| 895 |
+
var cacheBabelInterop = /* @__PURE__ */ new WeakMap(), cacheNodeInterop = /* @__PURE__ */ new WeakMap();
|
| 896 |
+
return (_getRequireWildcardCache = function(nodeInterop2) {
|
| 897 |
+
return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
|
| 898 |
+
})(nodeInterop);
|
| 899 |
+
}
|
| 900 |
+
function _interopRequireWildcard(obj, nodeInterop) {
|
| 901 |
+
if (!nodeInterop && obj && obj.__esModule)
|
| 902 |
+
return obj;
|
| 903 |
+
if (obj === null || typeof obj != "object" && typeof obj != "function")
|
| 904 |
+
return { default: obj };
|
| 905 |
+
var cache = _getRequireWildcardCache(nodeInterop);
|
| 906 |
+
if (cache && cache.has(obj))
|
| 907 |
+
return cache.get(obj);
|
| 908 |
+
var newObj = {}, hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
| 909 |
+
for (var key in obj)
|
| 910 |
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
| 911 |
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
| 912 |
+
desc && (desc.get || desc.set) ? Object.defineProperty(newObj, key, desc) : newObj[key] = obj[key];
|
| 913 |
+
}
|
| 914 |
+
return newObj.default = obj, cache && cache.set(obj, newObj), newObj;
|
| 915 |
+
}
|
| 916 |
+
var getChildren = (arg, children = []) => (Array.isArray(arg) ? arg.forEach((item) => {
|
| 917 |
+
getChildren(item, children);
|
| 918 |
+
}) : arg != null && arg !== !1 && children.push(arg), children), getType = (element) => {
|
| 919 |
+
let type = element.type;
|
| 920 |
+
if (typeof type == "string")
|
| 921 |
+
return type;
|
| 922 |
+
if (typeof type == "function")
|
| 923 |
+
return type.displayName || type.name || "Unknown";
|
| 924 |
+
if (ReactIs.isFragment(element))
|
| 925 |
+
return "React.Fragment";
|
| 926 |
+
if (ReactIs.isSuspense(element))
|
| 927 |
+
return "React.Suspense";
|
| 928 |
+
if (typeof type == "object" && type !== null) {
|
| 929 |
+
if (ReactIs.isContextProvider(element))
|
| 930 |
+
return "Context.Provider";
|
| 931 |
+
if (ReactIs.isContextConsumer(element))
|
| 932 |
+
return "Context.Consumer";
|
| 933 |
+
if (ReactIs.isForwardRef(element)) {
|
| 934 |
+
if (type.displayName)
|
| 935 |
+
return type.displayName;
|
| 936 |
+
let functionName = type.render.displayName || type.render.name || "";
|
| 937 |
+
return functionName !== "" ? `ForwardRef(${functionName})` : "ForwardRef";
|
| 938 |
+
}
|
| 939 |
+
if (ReactIs.isMemo(element)) {
|
| 940 |
+
let functionName = type.displayName || type.type.displayName || type.type.name || "";
|
| 941 |
+
return functionName !== "" ? `Memo(${functionName})` : "Memo";
|
| 942 |
+
}
|
| 943 |
+
}
|
| 944 |
+
return "UNDEFINED";
|
| 945 |
+
}, getPropKeys = (element) => {
|
| 946 |
+
let { props } = element;
|
| 947 |
+
return Object.keys(props).filter((key) => key !== "children" && props[key] !== void 0).sort();
|
| 948 |
+
}, serialize = (element, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(getType(element), config) : (0, _markup.printElement)(getType(element), (0, _markup.printProps)(getPropKeys(element), element.props, config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
|
| 949 |
+
exports.serialize = serialize;
|
| 950 |
+
var test = (val) => val != null && ReactIs.isElement(val);
|
| 951 |
+
exports.test = test;
|
| 952 |
+
var plugin = {
|
| 953 |
+
serialize,
|
| 954 |
+
test
|
| 955 |
+
}, _default = plugin;
|
| 956 |
+
exports.default = _default;
|
| 957 |
+
}
|
| 958 |
+
}), require_ReactTestComponent = __commonJS({
|
| 959 |
+
"node_modules/pretty-format/build/plugins/ReactTestComponent.js"(exports) {
|
| 960 |
+
"use strict";
|
| 961 |
+
Object.defineProperty(exports, "__esModule", {
|
| 962 |
+
value: !0
|
| 963 |
+
}), exports.test = exports.serialize = exports.default = void 0;
|
| 964 |
+
var _markup = require_markup(), Symbol2 = globalThis["jest-symbol-do-not-touch"] || globalThis.Symbol, testSymbol = typeof Symbol2 == "function" && Symbol2.for ? Symbol2.for("react.test.json") : 245830487, getPropKeys = (object) => {
|
| 965 |
+
let { props } = object;
|
| 966 |
+
return props ? Object.keys(props).filter((key) => props[key] !== void 0).sort() : [];
|
| 967 |
+
}, serialize = (object, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(object.type, config) : (0, _markup.printElement)(object.type, object.props ? (0, _markup.printProps)(getPropKeys(object), object.props, config, indentation + config.indent, depth, refs, printer) : "", object.children ? (0, _markup.printChildren)(object.children, config, indentation + config.indent, depth, refs, printer) : "", config, indentation);
|
| 968 |
+
exports.serialize = serialize;
|
| 969 |
+
var test = (val) => val && val.$$typeof === testSymbol;
|
| 970 |
+
exports.test = test;
|
| 971 |
+
var plugin = {
|
| 972 |
+
serialize,
|
| 973 |
+
test
|
| 974 |
+
}, _default = plugin;
|
| 975 |
+
exports.default = _default;
|
| 976 |
+
}
|
| 977 |
+
}), require_build = __commonJS({
|
| 978 |
+
"node_modules/pretty-format/build/index.js"(exports) {
|
| 979 |
+
"use strict";
|
| 980 |
+
Object.defineProperty(exports, "__esModule", {
|
| 981 |
+
value: !0
|
| 982 |
+
}), exports.default = exports.DEFAULT_OPTIONS = void 0, exports.format = format, exports.plugins = void 0;
|
| 983 |
+
var _ansiStyles = _interopRequireDefault(require_ansi_styles()), _collections = require_collections(), _AsymmetricMatcher = _interopRequireDefault(require_AsymmetricMatcher()), _ConvertAnsi = _interopRequireDefault(require_ConvertAnsi()), _DOMCollection = _interopRequireDefault(require_DOMCollection()), _DOMElement = _interopRequireDefault(require_DOMElement()), _Immutable = _interopRequireDefault(require_Immutable()), _ReactElement = _interopRequireDefault(require_ReactElement()), _ReactTestComponent = _interopRequireDefault(require_ReactTestComponent());
|
| 984 |
+
function _interopRequireDefault(obj) {
|
| 985 |
+
return obj && obj.__esModule ? obj : { default: obj };
|
| 986 |
+
}
|
| 987 |
+
var toString = Object.prototype.toString, toISOString = Date.prototype.toISOString, errorToString = Error.prototype.toString, regExpToString = RegExp.prototype.toString, getConstructorName = (val) => typeof val.constructor == "function" && val.constructor.name || "Object", isWindow = (val) => typeof window < "u" && val === window, SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/, NEWLINE_REGEXP = /\n/gi, PrettyFormatPluginError = class extends Error {
|
| 988 |
+
constructor(message, stack) {
|
| 989 |
+
super(message), this.stack = stack, this.name = this.constructor.name;
|
| 990 |
+
}
|
| 991 |
+
};
|
| 992 |
+
function isToStringedArrayType(toStringed) {
|
| 993 |
+
return toStringed === "[object Array]" || toStringed === "[object ArrayBuffer]" || toStringed === "[object DataView]" || toStringed === "[object Float32Array]" || toStringed === "[object Float64Array]" || toStringed === "[object Int8Array]" || toStringed === "[object Int16Array]" || toStringed === "[object Int32Array]" || toStringed === "[object Uint8Array]" || toStringed === "[object Uint8ClampedArray]" || toStringed === "[object Uint16Array]" || toStringed === "[object Uint32Array]";
|
| 994 |
+
}
|
| 995 |
+
function printNumber(val) {
|
| 996 |
+
return Object.is(val, -0) ? "-0" : String(val);
|
| 997 |
+
}
|
| 998 |
+
function printBigInt(val) {
|
| 999 |
+
return `${val}n`;
|
| 1000 |
+
}
|
| 1001 |
+
function printFunction(val, printFunctionName) {
|
| 1002 |
+
return printFunctionName ? `[Function ${val.name || "anonymous"}]` : "[Function]";
|
| 1003 |
+
}
|
| 1004 |
+
function printSymbol(val) {
|
| 1005 |
+
return String(val).replace(SYMBOL_REGEXP, "Symbol($1)");
|
| 1006 |
+
}
|
| 1007 |
+
function printError(val) {
|
| 1008 |
+
return `[${errorToString.call(val)}]`;
|
| 1009 |
+
}
|
| 1010 |
+
function printBasicValue(val, printFunctionName, escapeRegex, escapeString) {
|
| 1011 |
+
if (val === !0 || val === !1)
|
| 1012 |
+
return `${val}`;
|
| 1013 |
+
if (val === void 0)
|
| 1014 |
+
return "undefined";
|
| 1015 |
+
if (val === null)
|
| 1016 |
+
return "null";
|
| 1017 |
+
let typeOf = typeof val;
|
| 1018 |
+
if (typeOf === "number")
|
| 1019 |
+
return printNumber(val);
|
| 1020 |
+
if (typeOf === "bigint")
|
| 1021 |
+
return printBigInt(val);
|
| 1022 |
+
if (typeOf === "string")
|
| 1023 |
+
return escapeString ? `"${val.replace(/"|\\/g, "\\$&")}"` : `"${val}"`;
|
| 1024 |
+
if (typeOf === "function")
|
| 1025 |
+
return printFunction(val, printFunctionName);
|
| 1026 |
+
if (typeOf === "symbol")
|
| 1027 |
+
return printSymbol(val);
|
| 1028 |
+
let toStringed = toString.call(val);
|
| 1029 |
+
return toStringed === "[object WeakMap]" ? "WeakMap {}" : toStringed === "[object WeakSet]" ? "WeakSet {}" : toStringed === "[object Function]" || toStringed === "[object GeneratorFunction]" ? printFunction(val, printFunctionName) : toStringed === "[object Symbol]" ? printSymbol(val) : toStringed === "[object Date]" ? isNaN(+val) ? "Date { NaN }" : toISOString.call(val) : toStringed === "[object Error]" ? printError(val) : toStringed === "[object RegExp]" ? escapeRegex ? regExpToString.call(val).replace(/[\\^$*+?.()|[\]{}]/g, "\\$&") : regExpToString.call(val) : val instanceof Error ? printError(val) : null;
|
| 1030 |
+
}
|
| 1031 |
+
function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {
|
| 1032 |
+
if (refs.indexOf(val) !== -1)
|
| 1033 |
+
return "[Circular]";
|
| 1034 |
+
refs = refs.slice(), refs.push(val);
|
| 1035 |
+
let hitMaxDepth = ++depth > config.maxDepth, min = config.min;
|
| 1036 |
+
if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON == "function" && !hasCalledToJSON)
|
| 1037 |
+
return printer(val.toJSON(), config, indentation, depth, refs, !0);
|
| 1038 |
+
let toStringed = toString.call(val);
|
| 1039 |
+
return toStringed === "[object Arguments]" ? hitMaxDepth ? "[Arguments]" : `${min ? "" : "Arguments "}[${(0, _collections.printListItems)(val, config, indentation, depth, refs, printer)}]` : isToStringedArrayType(toStringed) ? hitMaxDepth ? `[${val.constructor.name}]` : `${min || !config.printBasicPrototype && val.constructor.name === "Array" ? "" : `${val.constructor.name} `}[${(0, _collections.printListItems)(val, config, indentation, depth, refs, printer)}]` : toStringed === "[object Map]" ? hitMaxDepth ? "[Map]" : `Map {${(0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer, " => ")}}` : toStringed === "[object Set]" ? hitMaxDepth ? "[Set]" : `Set {${(0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer)}}` : hitMaxDepth || isWindow(val) ? `[${getConstructorName(val)}]` : `${min || !config.printBasicPrototype && getConstructorName(val) === "Object" ? "" : `${getConstructorName(val)} `}{${(0, _collections.printObjectProperties)(val, config, indentation, depth, refs, printer)}}`;
|
| 1040 |
+
}
|
| 1041 |
+
function isNewPlugin(plugin) {
|
| 1042 |
+
return plugin.serialize != null;
|
| 1043 |
+
}
|
| 1044 |
+
function printPlugin(plugin, val, config, indentation, depth, refs) {
|
| 1045 |
+
let printed;
|
| 1046 |
+
try {
|
| 1047 |
+
printed = isNewPlugin(plugin) ? plugin.serialize(val, config, indentation, depth, refs, printer) : plugin.print(val, (valChild) => printer(valChild, config, indentation, depth, refs), (str) => {
|
| 1048 |
+
let indentationNext = indentation + config.indent;
|
| 1049 |
+
return indentationNext + str.replace(NEWLINE_REGEXP, `
|
| 1050 |
+
${indentationNext}`);
|
| 1051 |
+
}, {
|
| 1052 |
+
edgeSpacing: config.spacingOuter,
|
| 1053 |
+
min: config.min,
|
| 1054 |
+
spacing: config.spacingInner
|
| 1055 |
+
}, config.colors);
|
| 1056 |
+
} catch (error) {
|
| 1057 |
+
throw new PrettyFormatPluginError(error.message, error.stack);
|
| 1058 |
+
}
|
| 1059 |
+
if (typeof printed != "string")
|
| 1060 |
+
throw new Error(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`);
|
| 1061 |
+
return printed;
|
| 1062 |
+
}
|
| 1063 |
+
function findPlugin(plugins2, val) {
|
| 1064 |
+
for (let p = 0; p < plugins2.length; p++)
|
| 1065 |
+
try {
|
| 1066 |
+
if (plugins2[p].test(val))
|
| 1067 |
+
return plugins2[p];
|
| 1068 |
+
} catch (error) {
|
| 1069 |
+
throw new PrettyFormatPluginError(error.message, error.stack);
|
| 1070 |
+
}
|
| 1071 |
+
return null;
|
| 1072 |
+
}
|
| 1073 |
+
function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
|
| 1074 |
+
let plugin = findPlugin(config.plugins, val);
|
| 1075 |
+
if (plugin !== null)
|
| 1076 |
+
return printPlugin(plugin, val, config, indentation, depth, refs);
|
| 1077 |
+
let basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString);
|
| 1078 |
+
return basicResult !== null ? basicResult : printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
|
| 1079 |
+
}
|
| 1080 |
+
var DEFAULT_THEME = {
|
| 1081 |
+
comment: "gray",
|
| 1082 |
+
content: "reset",
|
| 1083 |
+
prop: "yellow",
|
| 1084 |
+
tag: "cyan",
|
| 1085 |
+
value: "green"
|
| 1086 |
+
}, DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME), DEFAULT_OPTIONS = {
|
| 1087 |
+
callToJSON: !0,
|
| 1088 |
+
compareKeys: void 0,
|
| 1089 |
+
escapeRegex: !1,
|
| 1090 |
+
escapeString: !0,
|
| 1091 |
+
highlight: !1,
|
| 1092 |
+
indent: 2,
|
| 1093 |
+
maxDepth: 1 / 0,
|
| 1094 |
+
maxWidth: 1 / 0,
|
| 1095 |
+
min: !1,
|
| 1096 |
+
plugins: [],
|
| 1097 |
+
printBasicPrototype: !0,
|
| 1098 |
+
printFunctionName: !0,
|
| 1099 |
+
theme: DEFAULT_THEME
|
| 1100 |
+
};
|
| 1101 |
+
exports.DEFAULT_OPTIONS = DEFAULT_OPTIONS;
|
| 1102 |
+
function validateOptions(options) {
|
| 1103 |
+
if (Object.keys(options).forEach((key) => {
|
| 1104 |
+
if (!Object.prototype.hasOwnProperty.call(DEFAULT_OPTIONS, key))
|
| 1105 |
+
throw new Error(`pretty-format: Unknown option "${key}".`);
|
| 1106 |
+
}), options.min && options.indent !== void 0 && options.indent !== 0)
|
| 1107 |
+
throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');
|
| 1108 |
+
if (options.theme !== void 0) {
|
| 1109 |
+
if (options.theme === null)
|
| 1110 |
+
throw new Error('pretty-format: Option "theme" must not be null.');
|
| 1111 |
+
if (typeof options.theme != "object")
|
| 1112 |
+
throw new Error(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof options.theme}".`);
|
| 1113 |
+
}
|
| 1114 |
+
}
|
| 1115 |
+
var getColorsHighlight = (options) => DEFAULT_THEME_KEYS.reduce((colors, key) => {
|
| 1116 |
+
let value = options.theme && options.theme[key] !== void 0 ? options.theme[key] : DEFAULT_THEME[key], color = value && _ansiStyles.default[value];
|
| 1117 |
+
if (color && typeof color.close == "string" && typeof color.open == "string")
|
| 1118 |
+
colors[key] = color;
|
| 1119 |
+
else
|
| 1120 |
+
throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);
|
| 1121 |
+
return colors;
|
| 1122 |
+
}, /* @__PURE__ */ Object.create(null)), getColorsEmpty = () => DEFAULT_THEME_KEYS.reduce((colors, key) => (colors[key] = {
|
| 1123 |
+
close: "",
|
| 1124 |
+
open: ""
|
| 1125 |
+
}, colors), /* @__PURE__ */ Object.create(null)), getPrintFunctionName = (options) => {
|
| 1126 |
+
var _options$printFunctio;
|
| 1127 |
+
return (_options$printFunctio = options?.printFunctionName) !== null && _options$printFunctio !== void 0 ? _options$printFunctio : DEFAULT_OPTIONS.printFunctionName;
|
| 1128 |
+
}, getEscapeRegex = (options) => {
|
| 1129 |
+
var _options$escapeRegex;
|
| 1130 |
+
return (_options$escapeRegex = options?.escapeRegex) !== null && _options$escapeRegex !== void 0 ? _options$escapeRegex : DEFAULT_OPTIONS.escapeRegex;
|
| 1131 |
+
}, getEscapeString = (options) => {
|
| 1132 |
+
var _options$escapeString;
|
| 1133 |
+
return (_options$escapeString = options?.escapeString) !== null && _options$escapeString !== void 0 ? _options$escapeString : DEFAULT_OPTIONS.escapeString;
|
| 1134 |
+
}, getConfig = (options) => {
|
| 1135 |
+
var _options$callToJSON, _options$indent, _options$maxDepth, _options$maxWidth, _options$min, _options$plugins, _options$printBasicPr;
|
| 1136 |
+
return {
|
| 1137 |
+
callToJSON: (_options$callToJSON = options?.callToJSON) !== null && _options$callToJSON !== void 0 ? _options$callToJSON : DEFAULT_OPTIONS.callToJSON,
|
| 1138 |
+
colors: options != null && options.highlight ? getColorsHighlight(options) : getColorsEmpty(),
|
| 1139 |
+
compareKeys: typeof options?.compareKeys == "function" ? options.compareKeys : DEFAULT_OPTIONS.compareKeys,
|
| 1140 |
+
escapeRegex: getEscapeRegex(options),
|
| 1141 |
+
escapeString: getEscapeString(options),
|
| 1142 |
+
indent: options != null && options.min ? "" : createIndent((_options$indent = options?.indent) !== null && _options$indent !== void 0 ? _options$indent : DEFAULT_OPTIONS.indent),
|
| 1143 |
+
maxDepth: (_options$maxDepth = options?.maxDepth) !== null && _options$maxDepth !== void 0 ? _options$maxDepth : DEFAULT_OPTIONS.maxDepth,
|
| 1144 |
+
maxWidth: (_options$maxWidth = options?.maxWidth) !== null && _options$maxWidth !== void 0 ? _options$maxWidth : DEFAULT_OPTIONS.maxWidth,
|
| 1145 |
+
min: (_options$min = options?.min) !== null && _options$min !== void 0 ? _options$min : DEFAULT_OPTIONS.min,
|
| 1146 |
+
plugins: (_options$plugins = options?.plugins) !== null && _options$plugins !== void 0 ? _options$plugins : DEFAULT_OPTIONS.plugins,
|
| 1147 |
+
printBasicPrototype: (_options$printBasicPr = options?.printBasicPrototype) !== null && _options$printBasicPr !== void 0 ? _options$printBasicPr : !0,
|
| 1148 |
+
printFunctionName: getPrintFunctionName(options),
|
| 1149 |
+
spacingInner: options != null && options.min ? " " : `
|
| 1150 |
+
`,
|
| 1151 |
+
spacingOuter: options != null && options.min ? "" : `
|
| 1152 |
+
`
|
| 1153 |
+
};
|
| 1154 |
+
};
|
| 1155 |
+
function createIndent(indent) {
|
| 1156 |
+
return new Array(indent + 1).join(" ");
|
| 1157 |
+
}
|
| 1158 |
+
function format(val, options) {
|
| 1159 |
+
if (options && (validateOptions(options), options.plugins)) {
|
| 1160 |
+
let plugin = findPlugin(options.plugins, val);
|
| 1161 |
+
if (plugin !== null)
|
| 1162 |
+
return printPlugin(plugin, val, getConfig(options), "", 0, []);
|
| 1163 |
+
}
|
| 1164 |
+
let basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options));
|
| 1165 |
+
return basicResult !== null ? basicResult : printComplexValue(val, getConfig(options), "", 0, []);
|
| 1166 |
+
}
|
| 1167 |
+
var plugins = {
|
| 1168 |
+
AsymmetricMatcher: _AsymmetricMatcher.default,
|
| 1169 |
+
ConvertAnsi: _ConvertAnsi.default,
|
| 1170 |
+
DOMCollection: _DOMCollection.default,
|
| 1171 |
+
DOMElement: _DOMElement.default,
|
| 1172 |
+
Immutable: _Immutable.default,
|
| 1173 |
+
ReactElement: _ReactElement.default,
|
| 1174 |
+
ReactTestComponent: _ReactTestComponent.default
|
| 1175 |
+
};
|
| 1176 |
+
exports.plugins = plugins;
|
| 1177 |
+
var _default = format;
|
| 1178 |
+
exports.default = _default;
|
| 1179 |
+
}
|
| 1180 |
+
}), import_pretty_format = __toESM(require_build(), 1), {
|
| 1181 |
+
AsymmetricMatcher,
|
| 1182 |
+
DOMCollection,
|
| 1183 |
+
DOMElement,
|
| 1184 |
+
Immutable,
|
| 1185 |
+
ReactElement,
|
| 1186 |
+
ReactTestComponent
|
| 1187 |
+
} = import_pretty_format.plugins, PLUGINS = [
|
| 1188 |
+
ReactTestComponent,
|
| 1189 |
+
ReactElement,
|
| 1190 |
+
DOMElement,
|
| 1191 |
+
DOMCollection,
|
| 1192 |
+
Immutable,
|
| 1193 |
+
AsymmetricMatcher
|
| 1194 |
+
], DIM_COLOR = source_default.dim, EXPECTED_COLOR = source_default.green, RECEIVED_COLOR = source_default.red, SPACE_SYMBOL = "\xB7";
|
| 1195 |
+
function stringify(object, maxDepth = 10, maxWidth = 10) {
|
| 1196 |
+
let MAX_LENGTH = 1e4, result;
|
| 1197 |
+
try {
|
| 1198 |
+
result = (0, import_pretty_format.format)(object, {
|
| 1199 |
+
maxDepth,
|
| 1200 |
+
maxWidth,
|
| 1201 |
+
min: !0,
|
| 1202 |
+
plugins: PLUGINS
|
| 1203 |
+
});
|
| 1204 |
+
} catch {
|
| 1205 |
+
result = (0, import_pretty_format.format)(object, {
|
| 1206 |
+
callToJSON: !1,
|
| 1207 |
+
maxDepth,
|
| 1208 |
+
maxWidth,
|
| 1209 |
+
min: !0,
|
| 1210 |
+
plugins: PLUGINS
|
| 1211 |
+
});
|
| 1212 |
+
}
|
| 1213 |
+
return result.length >= MAX_LENGTH && maxDepth > 1 ? stringify(object, Math.floor(maxDepth / 2), maxWidth) : result.length >= MAX_LENGTH && maxWidth > 1 ? stringify(object, maxDepth, Math.floor(maxWidth / 2)) : result;
|
| 1214 |
+
}
|
| 1215 |
+
function replaceTrailingSpaces(text) {
|
| 1216 |
+
return text.replace(/\s+$/gm, (spaces) => SPACE_SYMBOL.repeat(spaces.length));
|
| 1217 |
+
}
|
| 1218 |
+
function printReceived(object) {
|
| 1219 |
+
return RECEIVED_COLOR(replaceTrailingSpaces(stringify(object)));
|
| 1220 |
+
}
|
| 1221 |
+
function matcherHint(matcherName, received = "received", expected = "expected", options = {}) {
|
| 1222 |
+
let {
|
| 1223 |
+
comment = "",
|
| 1224 |
+
expectedColor = EXPECTED_COLOR,
|
| 1225 |
+
isDirectExpectCall = !1,
|
| 1226 |
+
isNot = !1,
|
| 1227 |
+
promise = "",
|
| 1228 |
+
receivedColor = RECEIVED_COLOR,
|
| 1229 |
+
secondArgument = "",
|
| 1230 |
+
secondArgumentColor = EXPECTED_COLOR
|
| 1231 |
+
} = options, hint = "", dimString = "expect";
|
| 1232 |
+
return !isDirectExpectCall && received !== "" && (hint += DIM_COLOR(`${dimString}(`) + receivedColor(received), dimString = ")"), promise !== "" && (hint += DIM_COLOR(`${dimString}.`) + promise, dimString = ""), isNot && (hint += `${DIM_COLOR(`${dimString}.`)}not`, dimString = ""), matcherName.includes(".") ? dimString += matcherName : (hint += DIM_COLOR(`${dimString}.`) + matcherName, dimString = ""), expected === "" ? dimString += "()" : (hint += DIM_COLOR(`${dimString}(`) + expectedColor(expected), secondArgument && (hint += DIM_COLOR(", ") + secondArgumentColor(secondArgument)), dimString = ")"), comment !== "" && (dimString += ` // ${comment}`), dimString !== "" && (hint += DIM_COLOR(dimString)), hint;
|
| 1233 |
+
}
|
| 1234 |
+
|
| 1235 |
+
// ../../../node_modules/vitest-axe/dist/matchers.js
|
| 1236 |
+
function toHaveNoViolations(results) {
|
| 1237 |
+
if (typeof results.violations > "u")
|
| 1238 |
+
throw new Error("No violations found in aXe results object");
|
| 1239 |
+
let violations = filterViolations(results.violations, results.toolOptions ? results.toolOptions.impactLevels : []);
|
| 1240 |
+
function reporter(violations2) {
|
| 1241 |
+
if (violations2.length === 0)
|
| 1242 |
+
return [];
|
| 1243 |
+
let lineBreak = `
|
| 1244 |
+
|
| 1245 |
+
`;
|
| 1246 |
+
return violations2.map((violation) => violation.nodes.map((node) => `Expected the HTML found at $('${node.target.join(", ")}') to have no violations:` + lineBreak + source_default.grey(node.html) + lineBreak + "Received:" + lineBreak + printReceived(`${violation.help} (${violation.id})`) + lineBreak + source_default.yellow(node.failureSummary) + lineBreak + (violation.helpUrl ? `You can find more information on this issue here:
|
| 1247 |
+
${source_default.blue(violation.helpUrl)}` : "")).join(lineBreak)).join(lineBreak + "\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500" + lineBreak);
|
| 1248 |
+
}
|
| 1249 |
+
let formatedViolations = reporter(violations), pass = formatedViolations.length === 0;
|
| 1250 |
+
function message() {
|
| 1251 |
+
if (!pass)
|
| 1252 |
+
return matcherHint(".toHaveNoViolations") + `
|
| 1253 |
+
|
| 1254 |
+
${formatedViolations}`;
|
| 1255 |
+
}
|
| 1256 |
+
return { actual: violations, message, pass };
|
| 1257 |
+
}
|
| 1258 |
+
function filterViolations(violations, impactLevels) {
|
| 1259 |
+
return impactLevels && impactLevels.length > 0 ? violations.filter((v) => impactLevels.includes(v.impact)) : violations;
|
| 1260 |
+
}
|
| 1261 |
+
export {
|
| 1262 |
+
toHaveNoViolations
|
| 1263 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/index.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as storybook_internal_csf from 'storybook/internal/csf';
|
| 2 |
+
import { Selector, SelectorList, RunOptions, Spec } from 'axe-core';
|
| 3 |
+
|
| 4 |
+
type SelectorWithoutNode = Omit<Selector, 'Node'> | Omit<SelectorList, 'NodeList'>;
|
| 5 |
+
type ContextObjectWithoutNode = {
|
| 6 |
+
include: SelectorWithoutNode;
|
| 7 |
+
exclude?: SelectorWithoutNode;
|
| 8 |
+
} | {
|
| 9 |
+
exclude: SelectorWithoutNode;
|
| 10 |
+
include?: SelectorWithoutNode;
|
| 11 |
+
};
|
| 12 |
+
type ContextSpecWithoutNode = SelectorWithoutNode | ContextObjectWithoutNode;
|
| 13 |
+
type A11yTest = 'off' | 'todo' | 'error';
|
| 14 |
+
interface A11yParameters$1 {
|
| 15 |
+
/**
|
| 16 |
+
* Context parameter for axe-core's run function, except without support for passing Nodes and
|
| 17 |
+
* NodeLists directly.
|
| 18 |
+
*
|
| 19 |
+
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/context.md
|
| 20 |
+
*/
|
| 21 |
+
context?: ContextSpecWithoutNode;
|
| 22 |
+
/**
|
| 23 |
+
* Options for running axe-core.
|
| 24 |
+
*
|
| 25 |
+
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter
|
| 26 |
+
*/
|
| 27 |
+
options?: RunOptions;
|
| 28 |
+
/**
|
| 29 |
+
* Configuration object for axe-core.
|
| 30 |
+
*
|
| 31 |
+
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axeconfigure
|
| 32 |
+
*/
|
| 33 |
+
config?: Spec;
|
| 34 |
+
/** Whether to disable accessibility tests. */
|
| 35 |
+
disable?: boolean;
|
| 36 |
+
/** Defines how accessibility violations should be handled: 'off', 'todo', or 'error'. */
|
| 37 |
+
test?: A11yTest;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
interface A11yParameters {
|
| 41 |
+
/**
|
| 42 |
+
* Accessibility configuration
|
| 43 |
+
*
|
| 44 |
+
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing
|
| 45 |
+
*/
|
| 46 |
+
a11y?: A11yParameters$1;
|
| 47 |
+
}
|
| 48 |
+
interface A11yGlobals {
|
| 49 |
+
/**
|
| 50 |
+
* Accessibility configuration
|
| 51 |
+
*
|
| 52 |
+
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing
|
| 53 |
+
*/
|
| 54 |
+
a11y?: {
|
| 55 |
+
/**
|
| 56 |
+
* Prevent the addon from executing automated accessibility checks upon visiting a story. You
|
| 57 |
+
* can still trigger the checks from the addon panel.
|
| 58 |
+
*
|
| 59 |
+
* @see https://storybook.js.org/docs/writing-tests/accessibility-testing#disable-automated-checks
|
| 60 |
+
*/
|
| 61 |
+
manual?: boolean;
|
| 62 |
+
};
|
| 63 |
+
}
|
| 64 |
+
interface A11yTypes {
|
| 65 |
+
parameters: A11yParameters;
|
| 66 |
+
globals: A11yGlobals;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
declare const PARAM_KEY = "a11y";
|
| 70 |
+
|
| 71 |
+
declare const _default: () => storybook_internal_csf.PreviewAddon<A11yTypes>;
|
| 72 |
+
|
| 73 |
+
export { type A11yGlobals, type A11yParameters$1 as A11yParameters, type A11yTypes, type ContextObjectWithoutNode, type ContextSpecWithoutNode, PARAM_KEY, type SelectorWithoutNode, _default as default };
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import {
|
| 2 |
+
preview_exports
|
| 3 |
+
} from "./_browser-chunks/chunk-2FVV6YOY.js";
|
| 4 |
+
import {
|
| 5 |
+
PARAM_KEY
|
| 6 |
+
} from "./_browser-chunks/chunk-7OPMK7TU.js";
|
| 7 |
+
import "./_browser-chunks/chunk-4BE7D4DS.js";
|
| 8 |
+
|
| 9 |
+
// src/index.ts
|
| 10 |
+
import { definePreviewAddon } from "storybook/internal/csf";
|
| 11 |
+
var index_default = () => definePreviewAddon(preview_exports);
|
| 12 |
+
export {
|
| 13 |
+
PARAM_KEY,
|
| 14 |
+
index_default as default
|
| 15 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/manager.js
ADDED
|
@@ -0,0 +1,2181 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import {
|
| 2 |
+
ADDON_ID,
|
| 3 |
+
DOCUMENTATION_DISCREPANCY_LINK,
|
| 4 |
+
EVENTS,
|
| 5 |
+
PANEL_ID,
|
| 6 |
+
PARAM_KEY,
|
| 7 |
+
STATUS_TYPE_ID_A11Y,
|
| 8 |
+
STATUS_TYPE_ID_COMPONENT_TEST,
|
| 9 |
+
VISION_GLOBAL_KEY,
|
| 10 |
+
filterDefs,
|
| 11 |
+
filters
|
| 12 |
+
} from "./_browser-chunks/chunk-7OPMK7TU.js";
|
| 13 |
+
import "./_browser-chunks/chunk-4BE7D4DS.js";
|
| 14 |
+
|
| 15 |
+
// src/manager.tsx
|
| 16 |
+
import React8 from "react";
|
| 17 |
+
import { Badge as Badge3 } from "storybook/internal/components";
|
| 18 |
+
import { addons, types, useAddonState as useAddonState2, useStorybookApi as useStorybookApi3 } from "storybook/manager-api";
|
| 19 |
+
|
| 20 |
+
// src/components/A11YPanel.tsx
|
| 21 |
+
import React6, { useMemo as useMemo3 } from "react";
|
| 22 |
+
import { Badge as Badge2, Button as Button4 } from "storybook/internal/components";
|
| 23 |
+
import { SyncIcon as SyncIcon2 } from "@storybook/icons";
|
| 24 |
+
import { styled as styled5 } from "storybook/theming";
|
| 25 |
+
|
| 26 |
+
// src/types.ts
|
| 27 |
+
var RuleType = {
|
| 28 |
+
VIOLATION: "violations",
|
| 29 |
+
PASS: "passes",
|
| 30 |
+
INCOMPLETION: "incomplete"
|
| 31 |
+
};
|
| 32 |
+
|
| 33 |
+
// src/components/A11yContext.tsx
|
| 34 |
+
import React, { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
|
| 35 |
+
import {
|
| 36 |
+
STORY_CHANGED,
|
| 37 |
+
STORY_FINISHED,
|
| 38 |
+
STORY_HOT_UPDATED,
|
| 39 |
+
STORY_RENDER_PHASE_CHANGED
|
| 40 |
+
} from "storybook/internal/core-events";
|
| 41 |
+
import { HIGHLIGHT, REMOVE_HIGHLIGHT, SCROLL_INTO_VIEW } from "storybook/highlight";
|
| 42 |
+
import {
|
| 43 |
+
experimental_getStatusStore,
|
| 44 |
+
experimental_useStatusStore,
|
| 45 |
+
useAddonState,
|
| 46 |
+
useChannel,
|
| 47 |
+
useGlobals,
|
| 48 |
+
useParameter,
|
| 49 |
+
useStorybookApi,
|
| 50 |
+
useStorybookState
|
| 51 |
+
} from "storybook/manager-api";
|
| 52 |
+
import { convert, themes } from "storybook/theming";
|
| 53 |
+
|
| 54 |
+
// src/AccessibilityRuleMaps.ts
|
| 55 |
+
var axeRuleMapping_wcag_2_0_a_aa = {
|
| 56 |
+
"area-alt": {
|
| 57 |
+
title: "<area> alt text",
|
| 58 |
+
axeSummary: "Ensure <area> elements of image maps have alternative text",
|
| 59 |
+
friendlySummary: "Add alt text to all <area> elements of image maps."
|
| 60 |
+
},
|
| 61 |
+
"aria-allowed-attr": {
|
| 62 |
+
title: "Supported ARIA attributes",
|
| 63 |
+
axeSummary: "Ensure an element's role supports its ARIA attributes",
|
| 64 |
+
friendlySummary: "Only use ARIA attributes that are permitted for the element's role."
|
| 65 |
+
},
|
| 66 |
+
"aria-braille-equivalent": {
|
| 67 |
+
title: "Braille equivalent",
|
| 68 |
+
axeSummary: "Ensure aria-braillelabel and aria-brailleroledescription have a non-braille equivalent",
|
| 69 |
+
friendlySummary: "If you use braille ARIA labels, also provide a matching non-braille label."
|
| 70 |
+
},
|
| 71 |
+
"aria-command-name": {
|
| 72 |
+
title: "ARIA command name",
|
| 73 |
+
axeSummary: "Ensure every ARIA button, link and menuitem has an accessible name",
|
| 74 |
+
friendlySummary: "Every ARIA button, link, or menuitem needs a label or accessible name."
|
| 75 |
+
},
|
| 76 |
+
"aria-conditional-attr": {
|
| 77 |
+
title: "ARIA attribute valid for role",
|
| 78 |
+
axeSummary: "Ensure ARIA attributes are used as described in the specification of the element's role",
|
| 79 |
+
friendlySummary: "Follow the element role's specification when using ARIA attributes."
|
| 80 |
+
},
|
| 81 |
+
"aria-deprecated-role": {
|
| 82 |
+
title: "Deprecated ARIA role",
|
| 83 |
+
axeSummary: "Ensure elements do not use deprecated roles",
|
| 84 |
+
friendlySummary: "Don't use deprecated ARIA roles on elements."
|
| 85 |
+
},
|
| 86 |
+
"aria-hidden-body": {
|
| 87 |
+
title: "Hidden body",
|
| 88 |
+
axeSummary: 'Ensure aria-hidden="true" is not present on the document <body>',
|
| 89 |
+
friendlySummary: 'Never set aria-hidden="true" on the <body> element.'
|
| 90 |
+
},
|
| 91 |
+
"aria-hidden-focus": {
|
| 92 |
+
title: "Hidden element focus",
|
| 93 |
+
axeSummary: "Ensure aria-hidden elements are not focusable nor contain focusable elements",
|
| 94 |
+
friendlySummary: "Elements marked hidden (aria-hidden) should not be focusable or contain focusable items."
|
| 95 |
+
},
|
| 96 |
+
"aria-input-field-name": {
|
| 97 |
+
title: "ARIA input field name",
|
| 98 |
+
axeSummary: "Ensure every ARIA input field has an accessible name",
|
| 99 |
+
friendlySummary: "Give each ARIA text input or field a label or accessible name."
|
| 100 |
+
},
|
| 101 |
+
"aria-meter-name": {
|
| 102 |
+
title: "ARIA meter name",
|
| 103 |
+
axeSummary: "Ensure every ARIA meter node has an accessible name",
|
| 104 |
+
friendlySummary: 'Give each element with role="meter" a label or accessible name.'
|
| 105 |
+
},
|
| 106 |
+
"aria-progressbar-name": {
|
| 107 |
+
title: "ARIA progressbar name",
|
| 108 |
+
axeSummary: "Ensure every ARIA progressbar node has an accessible name",
|
| 109 |
+
friendlySummary: 'Give each element with role="progressbar" a label or accessible name.'
|
| 110 |
+
},
|
| 111 |
+
"aria-prohibited-attr": {
|
| 112 |
+
title: "ARIA prohibited attributes",
|
| 113 |
+
axeSummary: "Ensure ARIA attributes are not prohibited for an element's role",
|
| 114 |
+
friendlySummary: "Don't use ARIA attributes that are forbidden for that element's role."
|
| 115 |
+
},
|
| 116 |
+
"aria-required-attr": {
|
| 117 |
+
title: "ARIA required attributes",
|
| 118 |
+
axeSummary: "Ensure elements with ARIA roles have all required ARIA attributes",
|
| 119 |
+
friendlySummary: "Include all required ARIA attributes for elements with that ARIA role."
|
| 120 |
+
},
|
| 121 |
+
"aria-required-children": {
|
| 122 |
+
title: "ARIA required children",
|
| 123 |
+
axeSummary: "Ensure elements with an ARIA role that require child roles contain them",
|
| 124 |
+
friendlySummary: "If an ARIA role requires specific child roles, include those child elements."
|
| 125 |
+
},
|
| 126 |
+
"aria-required-parent": {
|
| 127 |
+
title: "ARIA required parent",
|
| 128 |
+
axeSummary: "Ensure elements with an ARIA role that require parent roles are contained by them",
|
| 129 |
+
friendlySummary: "Place elements with certain ARIA roles inside the required parent role element."
|
| 130 |
+
},
|
| 131 |
+
"aria-roles": {
|
| 132 |
+
title: "ARIA role value",
|
| 133 |
+
axeSummary: "Ensure all elements with a role attribute use a valid value",
|
| 134 |
+
friendlySummary: "Use only valid values in the role attribute (no typos or invalid roles)."
|
| 135 |
+
},
|
| 136 |
+
"aria-toggle-field-name": {
|
| 137 |
+
title: "ARIA toggle field name",
|
| 138 |
+
axeSummary: "Ensure every ARIA toggle field has an accessible name",
|
| 139 |
+
friendlySummary: "Every ARIA toggle field (elements with the checkbox, radio, or switch roles) needs an accessible name."
|
| 140 |
+
},
|
| 141 |
+
"aria-tooltip-name": {
|
| 142 |
+
title: "ARIA tooltip name",
|
| 143 |
+
axeSummary: "Ensure every ARIA tooltip node has an accessible name",
|
| 144 |
+
friendlySummary: 'Give each element with role="tooltip" a descriptive accessible name.'
|
| 145 |
+
},
|
| 146 |
+
"aria-valid-attr-value": {
|
| 147 |
+
title: "ARIA attribute values valid",
|
| 148 |
+
axeSummary: "Ensure all ARIA attributes have valid values",
|
| 149 |
+
friendlySummary: "Use only valid values for ARIA attributes (no typos or invalid values)."
|
| 150 |
+
},
|
| 151 |
+
"aria-valid-attr": {
|
| 152 |
+
title: "ARIA attribute valid",
|
| 153 |
+
axeSummary: "Ensure attributes that begin with aria- are valid ARIA attributes",
|
| 154 |
+
friendlySummary: "Use only valid aria-* attributes (make sure the attribute name is correct)."
|
| 155 |
+
},
|
| 156 |
+
blink: {
|
| 157 |
+
title: "<blink> element",
|
| 158 |
+
axeSummary: "Ensure <blink> elements are not used",
|
| 159 |
+
friendlySummary: "Don't use the deprecated <blink> element."
|
| 160 |
+
},
|
| 161 |
+
"button-name": {
|
| 162 |
+
title: "Button name",
|
| 163 |
+
axeSummary: "Ensure buttons have discernible text",
|
| 164 |
+
friendlySummary: "Every <button> needs a visible label or accessible name."
|
| 165 |
+
},
|
| 166 |
+
bypass: {
|
| 167 |
+
title: "Navigation bypass",
|
| 168 |
+
axeSummary: "Ensure each page has at least one mechanism to bypass navigation and jump to content",
|
| 169 |
+
friendlySummary: 'Provide a way to skip repetitive navigation (e.g. a "Skip to content" link).'
|
| 170 |
+
},
|
| 171 |
+
"color-contrast": {
|
| 172 |
+
title: "Color contrast",
|
| 173 |
+
axeSummary: "Ensure the contrast between foreground and background text meets WCAG 2 AA minimum thresholds",
|
| 174 |
+
friendlySummary: "The color contrast between text and its background meets WCAG AA contrast ratio."
|
| 175 |
+
},
|
| 176 |
+
"definition-list": {
|
| 177 |
+
title: "Definition list structure",
|
| 178 |
+
axeSummary: "Ensure <dl> elements are structured correctly",
|
| 179 |
+
friendlySummary: "Definition lists (<dl>) should directly contain <dt> and <dd> elements in order."
|
| 180 |
+
},
|
| 181 |
+
dlitem: {
|
| 182 |
+
title: "Definition list items",
|
| 183 |
+
axeSummary: "Ensure <dt> and <dd> elements are contained by a <dl>",
|
| 184 |
+
friendlySummary: "Ensure <dt> and <dd> elements are contained by a <dl>"
|
| 185 |
+
},
|
| 186 |
+
"document-title": {
|
| 187 |
+
title: "Document title",
|
| 188 |
+
axeSummary: "Ensure each HTML document contains a non-empty <title> element",
|
| 189 |
+
friendlySummary: "Include a non-empty <title> element for every page."
|
| 190 |
+
},
|
| 191 |
+
"duplicate-id-aria": {
|
| 192 |
+
title: "Unique id",
|
| 193 |
+
axeSummary: "Ensure every id attribute value used in ARIA and in labels is unique",
|
| 194 |
+
friendlySummary: "Every id used for ARIA or form labels should be unique on the page."
|
| 195 |
+
},
|
| 196 |
+
"form-field-multiple-labels": {
|
| 197 |
+
title: "Multiple form field labels",
|
| 198 |
+
axeSummary: "Ensure a form field does not have multiple <label> elements",
|
| 199 |
+
friendlySummary: "Don't give a single form field more than one <label>."
|
| 200 |
+
},
|
| 201 |
+
"frame-focusable-content": {
|
| 202 |
+
title: "Focusable frames",
|
| 203 |
+
axeSummary: 'Ensure <frame> and <iframe> with focusable content do not have tabindex="-1"',
|
| 204 |
+
friendlySummary: `Don't set tabindex="-1" on a <frame> or <iframe> that contains focusable elements.`
|
| 205 |
+
},
|
| 206 |
+
"frame-title-unique": {
|
| 207 |
+
title: "Unique frame title",
|
| 208 |
+
axeSummary: "Ensure <iframe> and <frame> elements contain a unique title attribute",
|
| 209 |
+
friendlySummary: "Use a unique title attribute for each <frame> or <iframe> on the page."
|
| 210 |
+
},
|
| 211 |
+
"frame-title": {
|
| 212 |
+
title: "Frame title",
|
| 213 |
+
axeSummary: "Ensure <iframe> and <frame> elements have an accessible name",
|
| 214 |
+
friendlySummary: "Every <frame> and <iframe> needs a title or accessible name."
|
| 215 |
+
},
|
| 216 |
+
"html-has-lang": {
|
| 217 |
+
title: "<html> has lang",
|
| 218 |
+
axeSummary: "Ensure every HTML document has a lang attribute",
|
| 219 |
+
friendlySummary: "Add a lang attribute to the <html> element."
|
| 220 |
+
},
|
| 221 |
+
"html-lang-valid": {
|
| 222 |
+
title: "<html> lang valid",
|
| 223 |
+
axeSummary: "Ensure the <html lang> attribute has a valid value",
|
| 224 |
+
friendlySummary: "Use a valid language code in the <html lang> attribute."
|
| 225 |
+
},
|
| 226 |
+
"html-xml-lang-mismatch": {
|
| 227 |
+
title: "HTML and XML lang mismatch",
|
| 228 |
+
axeSummary: "Ensure that HTML elements with both lang and xml:lang agree on the page's language",
|
| 229 |
+
friendlySummary: "If using both lang and xml:lang on <html>, make sure they are the same language."
|
| 230 |
+
},
|
| 231 |
+
"image-alt": {
|
| 232 |
+
title: "Image alt text",
|
| 233 |
+
axeSummary: "Ensure <img> elements have alternative text or a role of none/presentation",
|
| 234 |
+
friendlySummary: 'Give every image alt text or mark it as decorative with alt="".'
|
| 235 |
+
},
|
| 236 |
+
"input-button-name": {
|
| 237 |
+
title: "Input button name",
|
| 238 |
+
axeSummary: "Ensure input buttons have discernible text",
|
| 239 |
+
friendlySummary: 'Give each <input type="button"> or similar a clear label (text or aria-label).'
|
| 240 |
+
},
|
| 241 |
+
"input-image-alt": {
|
| 242 |
+
title: "Input image alt",
|
| 243 |
+
axeSummary: 'Ensure <input type="image"> elements have alternative text',
|
| 244 |
+
friendlySummary: '<input type="image"> must have alt text describing its image.'
|
| 245 |
+
},
|
| 246 |
+
label: {
|
| 247 |
+
title: "Form label",
|
| 248 |
+
axeSummary: "Ensure every form element has a label",
|
| 249 |
+
friendlySummary: "Every form field needs an associated label."
|
| 250 |
+
},
|
| 251 |
+
"link-in-text-block": {
|
| 252 |
+
title: "Identifiable links",
|
| 253 |
+
axeSummary: "Ensure links are distinguishable from surrounding text without relying on color",
|
| 254 |
+
friendlySummary: "Make sure links are obviously identifiable without relying only on color."
|
| 255 |
+
},
|
| 256 |
+
"link-name": {
|
| 257 |
+
title: "Link name",
|
| 258 |
+
axeSummary: "Ensure links have discernible text",
|
| 259 |
+
friendlySummary: "Give each link meaningful text or an aria-label so its purpose is clear."
|
| 260 |
+
},
|
| 261 |
+
list: {
|
| 262 |
+
title: "List structure",
|
| 263 |
+
axeSummary: "Ensure that lists are structured correctly",
|
| 264 |
+
friendlySummary: "Use proper list structure. Only use <li> inside <ul> or <ol>."
|
| 265 |
+
},
|
| 266 |
+
listitem: {
|
| 267 |
+
title: "List item",
|
| 268 |
+
axeSummary: "Ensure <li> elements are used semantically",
|
| 269 |
+
friendlySummary: "Only use <li> tags inside <ul> or <ol> lists."
|
| 270 |
+
},
|
| 271 |
+
marquee: {
|
| 272 |
+
title: "<marquee> element",
|
| 273 |
+
axeSummary: "Ensure <marquee> elements are not used",
|
| 274 |
+
friendlySummary: "Don't use the deprecated <marquee> element."
|
| 275 |
+
},
|
| 276 |
+
"meta-refresh": {
|
| 277 |
+
title: "<meta> refresh",
|
| 278 |
+
axeSummary: 'Ensure <meta http-equiv="refresh"> is not used for delayed refresh',
|
| 279 |
+
friendlySummary: 'Avoid auto-refreshing or redirecting pages using <meta http-equiv="refresh">.'
|
| 280 |
+
},
|
| 281 |
+
"meta-viewport": {
|
| 282 |
+
title: "<meta> viewport scaling",
|
| 283 |
+
axeSummary: 'Ensure <meta name="viewport"> does not disable text scaling and zooming',
|
| 284 |
+
friendlySummary: `Don't disable user zooming in <meta name="viewport"> to allow scaling.`
|
| 285 |
+
},
|
| 286 |
+
"nested-interactive": {
|
| 287 |
+
title: "Nested interactive controls",
|
| 288 |
+
axeSummary: "Ensure interactive controls are not nested (nesting causes screen reader/focus issues)",
|
| 289 |
+
friendlySummary: "Do not nest interactive elements; it can confuse screen readers and keyboard focus."
|
| 290 |
+
},
|
| 291 |
+
"no-autoplay-audio": {
|
| 292 |
+
title: "Autoplaying video",
|
| 293 |
+
axeSummary: "Ensure <video> or <audio> do not autoplay audio > 3 seconds without a control to stop/mute",
|
| 294 |
+
friendlySummary: "Don't autoplay audio for more than 3 seconds without providing a way to stop or mute it."
|
| 295 |
+
},
|
| 296 |
+
"object-alt": {
|
| 297 |
+
title: "<object> alt text",
|
| 298 |
+
axeSummary: "Ensure <object> elements have alternative text",
|
| 299 |
+
friendlySummary: "Provide alternative text or content for <object> elements."
|
| 300 |
+
},
|
| 301 |
+
"role-img-alt": {
|
| 302 |
+
title: 'role="img" alt text',
|
| 303 |
+
axeSummary: 'Ensure elements with role="img" have alternative text',
|
| 304 |
+
friendlySummary: 'Any element with role="img" needs alt text.'
|
| 305 |
+
},
|
| 306 |
+
"scrollable-region-focusable": {
|
| 307 |
+
title: "Scrollable element focusable",
|
| 308 |
+
axeSummary: "Ensure elements with scrollable content are keyboard-accessible",
|
| 309 |
+
friendlySummary: "If an area can scroll, ensure it can be focused and scrolled via keyboard."
|
| 310 |
+
},
|
| 311 |
+
"select-name": {
|
| 312 |
+
title: "<select> name",
|
| 313 |
+
axeSummary: "Ensure <select> elements have an accessible name",
|
| 314 |
+
friendlySummary: "Give each <select> field a label or other accessible name."
|
| 315 |
+
},
|
| 316 |
+
"server-side-image-map": {
|
| 317 |
+
title: "Server-side image map",
|
| 318 |
+
axeSummary: "Ensure that server-side image maps are not used",
|
| 319 |
+
friendlySummary: "Don't use server-side image maps."
|
| 320 |
+
},
|
| 321 |
+
"svg-img-alt": {
|
| 322 |
+
title: "SVG image alt text",
|
| 323 |
+
axeSummary: "Ensure <svg> images/graphics have accessible text",
|
| 324 |
+
friendlySummary: 'SVG images with role="img" or similar need a text description.'
|
| 325 |
+
},
|
| 326 |
+
"td-headers-attr": {
|
| 327 |
+
title: "Table headers attribute",
|
| 328 |
+
axeSummary: "Ensure each cell in a table using headers only refers to <th> in that table",
|
| 329 |
+
friendlySummary: "In tables using the headers attribute, only reference other cells in the same table."
|
| 330 |
+
},
|
| 331 |
+
"th-has-data-cells": {
|
| 332 |
+
title: "<th> has data cell",
|
| 333 |
+
axeSummary: "Ensure <th> (or header role) elements have data cells they describe",
|
| 334 |
+
friendlySummary: "Every table header (<th> or header role) should correspond to at least one data cell."
|
| 335 |
+
},
|
| 336 |
+
"valid-lang": {
|
| 337 |
+
title: "Valid lang",
|
| 338 |
+
axeSummary: "Ensure lang attributes have valid values",
|
| 339 |
+
friendlySummary: "Use valid language codes in all lang attributes."
|
| 340 |
+
},
|
| 341 |
+
"video-caption": {
|
| 342 |
+
title: "<video> captions",
|
| 343 |
+
axeSummary: "Ensure <video> elements have captions",
|
| 344 |
+
friendlySummary: "Provide captions for all <video> content."
|
| 345 |
+
}
|
| 346 |
+
}, axeRuleMapping_wcag_2_1_a_aa = {
|
| 347 |
+
"autocomplete-valid": {
|
| 348 |
+
title: "autocomplete attribute valid",
|
| 349 |
+
axeSummary: "Ensure the autocomplete attribute is correct and suitable for the form field",
|
| 350 |
+
friendlySummary: "Use valid autocomplete values that match the form field's purpose."
|
| 351 |
+
},
|
| 352 |
+
"avoid-inline-spacing": {
|
| 353 |
+
title: "Forced inline spacing",
|
| 354 |
+
axeSummary: "Ensure that text spacing set via inline styles can be adjusted with custom CSS",
|
| 355 |
+
friendlySummary: "Don't lock in text spacing with forced (!important) inline styles\u2014allow user CSS to adjust text spacing."
|
| 356 |
+
}
|
| 357 |
+
}, axeRuleMapping_wcag_2_2_a_aa = {
|
| 358 |
+
"target-size": {
|
| 359 |
+
title: "Touch target size",
|
| 360 |
+
axeSummary: "Ensure touch targets have sufficient size and space",
|
| 361 |
+
friendlySummary: "Make sure interactive elements are big enough and not too close together for touch."
|
| 362 |
+
}
|
| 363 |
+
}, axeRuleMapping_best_practices = {
|
| 364 |
+
accesskeys: {
|
| 365 |
+
title: "Unique accesskey",
|
| 366 |
+
axeSummary: "Ensure every accesskey attribute value is unique",
|
| 367 |
+
friendlySummary: "Use unique values for all accesskey attributes."
|
| 368 |
+
},
|
| 369 |
+
"aria-allowed-role": {
|
| 370 |
+
title: "Appropriate role value",
|
| 371 |
+
axeSummary: "Ensure the role attribute has an appropriate value for the element",
|
| 372 |
+
friendlySummary: "ARIA roles should have a valid value for the element."
|
| 373 |
+
},
|
| 374 |
+
"aria-dialog-name": {
|
| 375 |
+
title: "ARIA dialog name",
|
| 376 |
+
axeSummary: "Ensure every ARIA dialog and alertdialog has an accessible name",
|
| 377 |
+
friendlySummary: "Give each ARIA dialog or alertdialog a title or accessible name."
|
| 378 |
+
},
|
| 379 |
+
"aria-text": {
|
| 380 |
+
title: 'ARIA role="text"',
|
| 381 |
+
axeSummary: 'Ensure role="text" is used on elements with no focusable descendants',
|
| 382 |
+
friendlySummary: `Only use role="text" on elements that don't contain focusable elements.`
|
| 383 |
+
},
|
| 384 |
+
"aria-treeitem-name": {
|
| 385 |
+
title: "ARIA treeitem name",
|
| 386 |
+
axeSummary: "Ensure every ARIA treeitem node has an accessible name",
|
| 387 |
+
friendlySummary: "Give each ARIA treeitem a label or accessible name."
|
| 388 |
+
},
|
| 389 |
+
"empty-heading": {
|
| 390 |
+
title: "Empty heading",
|
| 391 |
+
axeSummary: "Ensure headings have discernible text",
|
| 392 |
+
friendlySummary: "Don't leave heading elements empty or hide them."
|
| 393 |
+
},
|
| 394 |
+
"empty-table-header": {
|
| 395 |
+
title: "Empty table header",
|
| 396 |
+
axeSummary: "Ensure table headers have discernible text",
|
| 397 |
+
friendlySummary: "Make sure table header cells have visible text."
|
| 398 |
+
},
|
| 399 |
+
"frame-tested": {
|
| 400 |
+
title: "Test all frames",
|
| 401 |
+
axeSummary: "Ensure <iframe> and <frame> elements contain the axe-core script",
|
| 402 |
+
friendlySummary: "Make sure axe-core is injected into all frames or iframes so they are tested."
|
| 403 |
+
},
|
| 404 |
+
"heading-order": {
|
| 405 |
+
title: "Heading order",
|
| 406 |
+
axeSummary: "Ensure the order of headings is semantically correct (no skipping levels)",
|
| 407 |
+
friendlySummary: "Use proper heading order (don't skip heading levels)."
|
| 408 |
+
},
|
| 409 |
+
"image-redundant-alt": {
|
| 410 |
+
title: "Redundant image alt text",
|
| 411 |
+
axeSummary: "Ensure image alternative text is not repeated as nearby text",
|
| 412 |
+
friendlySummary: "Avoid repeating the same information in both an image's alt text and nearby text."
|
| 413 |
+
},
|
| 414 |
+
"label-title-only": {
|
| 415 |
+
title: "Visible form element label",
|
| 416 |
+
axeSummary: "Ensure each form element has a visible label (not only title/ARIA)",
|
| 417 |
+
friendlySummary: "Every form input needs a visible label (not only a title attribute or hidden text)."
|
| 418 |
+
},
|
| 419 |
+
"landmark-banner-is-top-level": {
|
| 420 |
+
title: "Top-level landmark banner",
|
| 421 |
+
axeSummary: "Ensure the banner landmark is at top level (not nested)",
|
| 422 |
+
friendlySummary: "Use the banner landmark (e.g. site header) only at the top level of the page, not inside another landmark."
|
| 423 |
+
},
|
| 424 |
+
"landmark-complementary-is-top-level": {
|
| 425 |
+
title: "Top-level <aside>",
|
| 426 |
+
axeSummary: "Ensure the complementary landmark (<aside>) is top level",
|
| 427 |
+
friendlySummary: 'The complementary landmark <aside> or role="complementary" should be a top-level region, not nested in another landmark.'
|
| 428 |
+
},
|
| 429 |
+
"landmark-contentinfo-is-top-level": {
|
| 430 |
+
title: "Top-level contentinfo",
|
| 431 |
+
axeSummary: "Ensure the contentinfo landmark (footer) is top level",
|
| 432 |
+
friendlySummary: "Make sure the contentinfo landmark (footer) is at the top level of the page and not contained in another landmark."
|
| 433 |
+
},
|
| 434 |
+
"landmark-main-is-top-level": {
|
| 435 |
+
title: "Top-level main",
|
| 436 |
+
axeSummary: "Ensure the main landmark is at top level",
|
| 437 |
+
friendlySummary: "The main landmark should be a top-level element and not nested inside another landmark."
|
| 438 |
+
},
|
| 439 |
+
"landmark-no-duplicate-banner": {
|
| 440 |
+
title: "Duplicate banner landmark",
|
| 441 |
+
axeSummary: "Ensure the document has at most one banner landmark",
|
| 442 |
+
friendlySummary: 'Have only one role="banner" or <header> on a page.'
|
| 443 |
+
},
|
| 444 |
+
"landmark-no-duplicate-contentinfo": {
|
| 445 |
+
title: "Duplicate contentinfo",
|
| 446 |
+
axeSummary: "Ensure the document has at most one contentinfo landmark",
|
| 447 |
+
friendlySummary: 'Have only one role="contentinfo" or <footer> on a page.'
|
| 448 |
+
},
|
| 449 |
+
"landmark-no-duplicate-main": {
|
| 450 |
+
title: "Duplicate main",
|
| 451 |
+
axeSummary: "Ensure the document has at most one main landmark",
|
| 452 |
+
friendlySummary: 'Have only one role="main" or <main> on a page.'
|
| 453 |
+
},
|
| 454 |
+
"landmark-one-main": {
|
| 455 |
+
title: "main landmark",
|
| 456 |
+
axeSummary: "Ensure the document has a main landmark",
|
| 457 |
+
friendlySummary: 'Include a main landmark on each page using a <main> region or role="main".'
|
| 458 |
+
},
|
| 459 |
+
"landmark-unique": {
|
| 460 |
+
title: "Unique landmark",
|
| 461 |
+
axeSummary: "Ensure landmarks have a unique role or role/label combination",
|
| 462 |
+
friendlySummary: "If you use multiple landmarks of the same type, give them unique labels (names)."
|
| 463 |
+
},
|
| 464 |
+
"meta-viewport-large": {
|
| 465 |
+
title: "Significant viewport scaling",
|
| 466 |
+
axeSummary: 'Ensure <meta name="viewport"> can scale a significant amount (e.g. 500%)',
|
| 467 |
+
friendlySummary: '<meta name="viewport"> should allow users to significantly scale content.'
|
| 468 |
+
},
|
| 469 |
+
"page-has-heading-one": {
|
| 470 |
+
title: "Has <h1>",
|
| 471 |
+
axeSummary: "Ensure the page (or at least one frame) contains a level-one heading",
|
| 472 |
+
friendlySummary: "Every page or frame should have at least one <h1> heading."
|
| 473 |
+
},
|
| 474 |
+
"presentation-role-conflict": {
|
| 475 |
+
title: "Presentational content",
|
| 476 |
+
axeSummary: 'Ensure elements with role="presentation"/"none" have no ARIA or tabindex',
|
| 477 |
+
friendlySummary: `Don't give elements with role="none"/"presentation" any ARIA attributes or a tabindex.`
|
| 478 |
+
},
|
| 479 |
+
region: {
|
| 480 |
+
title: "Landmark regions",
|
| 481 |
+
axeSummary: "Ensure all page content is contained by landmarks",
|
| 482 |
+
friendlySummary: "Wrap all page content in appropriate landmark regions (<header>, <main>, <footer>, etc.)."
|
| 483 |
+
},
|
| 484 |
+
"scope-attr-valid": {
|
| 485 |
+
title: "scope attribute",
|
| 486 |
+
axeSummary: "Ensure the scope attribute is used correctly on tables",
|
| 487 |
+
friendlySummary: "Use the scope attribute only on <th> elements, with proper values (col, row, etc.)."
|
| 488 |
+
},
|
| 489 |
+
"skip-link": {
|
| 490 |
+
title: "Skip link",
|
| 491 |
+
axeSummary: 'Ensure all "skip" links have a focusable target',
|
| 492 |
+
friendlySummary: 'Make sure any "skip to content" link targets an existing, focusable element.'
|
| 493 |
+
},
|
| 494 |
+
tabindex: {
|
| 495 |
+
title: "tabindex values",
|
| 496 |
+
axeSummary: "Ensure tabindex attribute values are not greater than 0",
|
| 497 |
+
friendlySummary: "Don't use tabindex values greater than 0."
|
| 498 |
+
},
|
| 499 |
+
"table-duplicate-name": {
|
| 500 |
+
title: "Duplicate names for table",
|
| 501 |
+
axeSummary: "Ensure the <caption> does not duplicate the summary attribute text",
|
| 502 |
+
friendlySummary: "Don't use the same text in both a table's <caption> and its summary attribute."
|
| 503 |
+
}
|
| 504 |
+
}, axeRuleMapping_wcag_2_x_aaa = {
|
| 505 |
+
"color-contrast-enhanced": {
|
| 506 |
+
title: "Enhanced color contrast",
|
| 507 |
+
axeSummary: "Ensure contrast between text and background meets WCAG 2 AAA enhanced contrast thresholds",
|
| 508 |
+
friendlySummary: "Use extra-high contrast for text and background to meet WCAG AAA level."
|
| 509 |
+
},
|
| 510 |
+
"identical-links-same-purpose": {
|
| 511 |
+
title: "Same link name, same purpose",
|
| 512 |
+
axeSummary: "Ensure links with the same accessible name serve a similar purpose",
|
| 513 |
+
friendlySummary: "If two links have the same text, they should do the same thing (lead to the same content)."
|
| 514 |
+
},
|
| 515 |
+
"meta-refresh-no-exceptions": {
|
| 516 |
+
title: 'No <meta http-equiv="refresh">',
|
| 517 |
+
axeSummary: 'Ensure <meta http-equiv="refresh"> is not used for delayed refresh (no exceptions)',
|
| 518 |
+
friendlySummary: `Don't auto-refresh or redirect pages using <meta http-equiv="refresh"> even with a delay.`
|
| 519 |
+
}
|
| 520 |
+
}, axeRuleMapping_experimental = {
|
| 521 |
+
"css-orientation-lock": {
|
| 522 |
+
title: "CSS orientation lock",
|
| 523 |
+
axeSummary: "Ensure content is not locked to a specific display orientation (works in all orientations)",
|
| 524 |
+
friendlySummary: "Don't lock content to one screen orientation; support both portrait and landscape modes."
|
| 525 |
+
},
|
| 526 |
+
"focus-order-semantics": {
|
| 527 |
+
title: "Focus order semantic role",
|
| 528 |
+
axeSummary: "Ensure elements in the tab order have a role appropriate for interactive content",
|
| 529 |
+
friendlySummary: "Ensure elements in the tab order have a role appropriate for interactive content"
|
| 530 |
+
},
|
| 531 |
+
"hidden-content": {
|
| 532 |
+
title: "Hidden content",
|
| 533 |
+
axeSummary: "Informs users about hidden content",
|
| 534 |
+
friendlySummary: "Display hidden content on the page for test analysis."
|
| 535 |
+
},
|
| 536 |
+
"label-content-name-mismatch": {
|
| 537 |
+
title: "Content name mismatch",
|
| 538 |
+
axeSummary: "Ensure elements labeled by their content include that text in their accessible name",
|
| 539 |
+
friendlySummary: "If an element's visible text serves as its label, include that text in its accessible name."
|
| 540 |
+
},
|
| 541 |
+
"p-as-heading": {
|
| 542 |
+
title: "No <p> headings",
|
| 543 |
+
axeSummary: "Ensure <p> elements aren't styled to look like headings (use real headings)",
|
| 544 |
+
friendlySummary: "Don't just style a <p> to look like a heading \u2013 use an actual heading tag for headings."
|
| 545 |
+
},
|
| 546 |
+
"table-fake-caption": {
|
| 547 |
+
title: "Table caption",
|
| 548 |
+
axeSummary: "Ensure that tables with a caption use the <caption> element",
|
| 549 |
+
friendlySummary: "Use a <caption> element for table captions instead of just styled text."
|
| 550 |
+
},
|
| 551 |
+
"td-has-header": {
|
| 552 |
+
title: "<td> has header",
|
| 553 |
+
axeSummary: "Ensure each non-empty data cell in large tables (3\xD73+) has one or more headers",
|
| 554 |
+
friendlySummary: "Every data cell in large tables should be associated with at least one header cell."
|
| 555 |
+
}
|
| 556 |
+
}, axeRuleMapping_deprecated = {
|
| 557 |
+
"aria-roledescription": {
|
| 558 |
+
title: "aria-roledescription",
|
| 559 |
+
axeSummary: "Ensure aria-roledescription is only used on elements with an implicit or explicit role",
|
| 560 |
+
friendlySummary: "Only use aria-roledescription on elements that already have a defined role."
|
| 561 |
+
}
|
| 562 |
+
}, combinedRulesMap = {
|
| 563 |
+
...axeRuleMapping_wcag_2_0_a_aa,
|
| 564 |
+
...axeRuleMapping_wcag_2_1_a_aa,
|
| 565 |
+
...axeRuleMapping_wcag_2_2_a_aa,
|
| 566 |
+
...axeRuleMapping_wcag_2_x_aaa,
|
| 567 |
+
...axeRuleMapping_best_practices,
|
| 568 |
+
...axeRuleMapping_experimental,
|
| 569 |
+
...axeRuleMapping_deprecated
|
| 570 |
+
};
|
| 571 |
+
|
| 572 |
+
// src/axeRuleMappingHelper.ts
|
| 573 |
+
var getTitleForAxeResult = (axeResult) => combinedRulesMap[axeResult.id]?.title || axeResult.id, getFriendlySummaryForAxeResult = (axeResult) => combinedRulesMap[axeResult.id]?.friendlySummary || axeResult.description;
|
| 574 |
+
|
| 575 |
+
// src/components/A11yContext.tsx
|
| 576 |
+
var unhighlightedSelectors = ["html", "body", "main"], theme = convert(themes.light), colorsByType = {
|
| 577 |
+
[RuleType.VIOLATION]: theme.color.negative,
|
| 578 |
+
[RuleType.PASS]: theme.color.positive,
|
| 579 |
+
[RuleType.INCOMPLETION]: theme.color.warning
|
| 580 |
+
}, A11yContext = createContext({
|
| 581 |
+
parameters: {},
|
| 582 |
+
results: void 0,
|
| 583 |
+
highlighted: !1,
|
| 584 |
+
toggleHighlight: () => {
|
| 585 |
+
},
|
| 586 |
+
tab: RuleType.VIOLATION,
|
| 587 |
+
handleCopyLink: () => {
|
| 588 |
+
},
|
| 589 |
+
setTab: () => {
|
| 590 |
+
},
|
| 591 |
+
setStatus: () => {
|
| 592 |
+
},
|
| 593 |
+
status: "initial",
|
| 594 |
+
error: void 0,
|
| 595 |
+
handleManual: () => {
|
| 596 |
+
},
|
| 597 |
+
discrepancy: null,
|
| 598 |
+
selectedItems: /* @__PURE__ */ new Map(),
|
| 599 |
+
allExpanded: !1,
|
| 600 |
+
toggleOpen: () => {
|
| 601 |
+
},
|
| 602 |
+
handleCollapseAll: () => {
|
| 603 |
+
},
|
| 604 |
+
handleExpandAll: () => {
|
| 605 |
+
},
|
| 606 |
+
handleJumpToElement: () => {
|
| 607 |
+
},
|
| 608 |
+
handleSelectionChange: () => {
|
| 609 |
+
}
|
| 610 |
+
}), A11yContextProvider = (props) => {
|
| 611 |
+
let parameters = useParameter("a11y", {}), [globals] = useGlobals() ?? [], api = useStorybookApi(), getInitialStatus = useCallback((manual2 = !1) => manual2 ? "manual" : "initial", []), manual = useMemo(() => globals?.a11y?.manual ?? !1, [globals?.a11y?.manual]), a11ySelection = useMemo(() => {
|
| 612 |
+
let value = api.getQueryParam("a11ySelection");
|
| 613 |
+
return value && api.setQueryParams({ a11ySelection: "" }), value;
|
| 614 |
+
}, [api]), [state, setState] = useAddonState(ADDON_ID, {
|
| 615 |
+
ui: {
|
| 616 |
+
highlighted: !1,
|
| 617 |
+
tab: RuleType.VIOLATION
|
| 618 |
+
},
|
| 619 |
+
results: void 0,
|
| 620 |
+
error: void 0,
|
| 621 |
+
status: getInitialStatus(manual)
|
| 622 |
+
}), { ui, results, error, status } = state, { storyId } = useStorybookState(), currentStoryA11yStatusValue = experimental_useStatusStore(
|
| 623 |
+
(allStatuses) => allStatuses[storyId]?.[STATUS_TYPE_ID_A11Y]?.value
|
| 624 |
+
);
|
| 625 |
+
useEffect(() => experimental_getStatusStore("storybook/component-test").onAllStatusChange(
|
| 626 |
+
(statuses, previousStatuses) => {
|
| 627 |
+
let current = statuses[storyId]?.[STATUS_TYPE_ID_COMPONENT_TEST], previous = previousStatuses[storyId]?.[STATUS_TYPE_ID_COMPONENT_TEST];
|
| 628 |
+
current?.value === "status-value:error" && previous?.value !== "status-value:error" && setState((prev) => ({ ...prev, status: "component-test-error" }));
|
| 629 |
+
}
|
| 630 |
+
), [setState, storyId]);
|
| 631 |
+
let handleToggleHighlight = useCallback(() => {
|
| 632 |
+
setState((prev) => ({ ...prev, ui: { ...prev.ui, highlighted: !prev.ui.highlighted } }));
|
| 633 |
+
}, [setState]), [selectedItems, setSelectedItems] = useState(() => {
|
| 634 |
+
let initialValue = /* @__PURE__ */ new Map();
|
| 635 |
+
if (a11ySelection && /^[a-z]+.[a-z-]+.[0-9]+$/.test(a11ySelection)) {
|
| 636 |
+
let [type, id] = a11ySelection.split(".");
|
| 637 |
+
initialValue.set(`${type}.${id}`, a11ySelection);
|
| 638 |
+
}
|
| 639 |
+
return initialValue;
|
| 640 |
+
}), allExpanded = useMemo(() => results?.[ui.tab]?.every((result) => selectedItems.has(`${ui.tab}.${result.id}`)) ?? !1, [results, selectedItems, ui.tab]), toggleOpen = useCallback(
|
| 641 |
+
(event, type, item) => {
|
| 642 |
+
event.stopPropagation();
|
| 643 |
+
let key = `${type}.${item.id}`;
|
| 644 |
+
setSelectedItems((prev) => new Map(prev.delete(key) ? prev : prev.set(key, `${key}.1`)));
|
| 645 |
+
},
|
| 646 |
+
[]
|
| 647 |
+
), handleCollapseAll = useCallback(() => {
|
| 648 |
+
setSelectedItems(/* @__PURE__ */ new Map());
|
| 649 |
+
}, []), handleExpandAll = useCallback(() => {
|
| 650 |
+
setSelectedItems(
|
| 651 |
+
(prev) => new Map(
|
| 652 |
+
results?.[ui.tab]?.map((result) => {
|
| 653 |
+
let key = `${ui.tab}.${result.id}`;
|
| 654 |
+
return [key, prev.get(key) ?? `${key}.1`];
|
| 655 |
+
}) ?? []
|
| 656 |
+
)
|
| 657 |
+
);
|
| 658 |
+
}, [results, ui.tab]), handleSelectionChange = useCallback((key) => {
|
| 659 |
+
let [type, id] = key.split(".");
|
| 660 |
+
setSelectedItems((prev) => new Map(prev.set(`${type}.${id}`, key)));
|
| 661 |
+
}, []), handleError = useCallback(
|
| 662 |
+
(err) => {
|
| 663 |
+
setState((prev) => ({ ...prev, status: "error", error: err }));
|
| 664 |
+
},
|
| 665 |
+
[setState]
|
| 666 |
+
), handleResult = useCallback(
|
| 667 |
+
(axeResults, id) => {
|
| 668 |
+
storyId === id && (setState((prev) => ({ ...prev, status: "ran", results: axeResults })), setTimeout(() => {
|
| 669 |
+
setState((prev) => prev.status === "ran" ? { ...prev, status: "ready" } : prev), setSelectedItems((prev) => {
|
| 670 |
+
if (prev.size === 1) {
|
| 671 |
+
let [key] = prev.values();
|
| 672 |
+
document.getElementById(key)?.scrollIntoView({ behavior: "smooth", block: "center" });
|
| 673 |
+
}
|
| 674 |
+
return prev;
|
| 675 |
+
});
|
| 676 |
+
}, 900));
|
| 677 |
+
},
|
| 678 |
+
[storyId, setState, setSelectedItems]
|
| 679 |
+
), handleSelect = useCallback(
|
| 680 |
+
(itemId, details) => {
|
| 681 |
+
let [type, id] = itemId.split("."), { helpUrl, nodes } = results?.[type]?.find((r) => r.id === id) || {}, openedWindow = helpUrl && window.open(helpUrl, "_blank", "noopener,noreferrer");
|
| 682 |
+
if (nodes && !openedWindow) {
|
| 683 |
+
let index = nodes.findIndex((n) => details.selectors.some((s) => s === String(n.target))) ?? -1;
|
| 684 |
+
if (index !== -1) {
|
| 685 |
+
let key = `${type}.${id}.${index + 1}`;
|
| 686 |
+
setSelectedItems(/* @__PURE__ */ new Map([[`${type}.${id}`, key]])), setTimeout(() => {
|
| 687 |
+
document.getElementById(key)?.scrollIntoView({ behavior: "smooth", block: "center" });
|
| 688 |
+
}, 100);
|
| 689 |
+
}
|
| 690 |
+
}
|
| 691 |
+
},
|
| 692 |
+
[results]
|
| 693 |
+
), handleReport = useCallback(
|
| 694 |
+
({ reporters }) => {
|
| 695 |
+
let a11yReport = reporters.find((r) => r.type === "a11y");
|
| 696 |
+
a11yReport && ("error" in a11yReport.result ? handleError(a11yReport.result.error) : handleResult(a11yReport.result, storyId));
|
| 697 |
+
},
|
| 698 |
+
[handleError, handleResult, storyId]
|
| 699 |
+
), handleReset = useCallback(
|
| 700 |
+
({ newPhase }) => {
|
| 701 |
+
newPhase === "loading" ? setState((prev) => ({
|
| 702 |
+
...prev,
|
| 703 |
+
results: void 0,
|
| 704 |
+
status: manual ? "manual" : "initial"
|
| 705 |
+
})) : newPhase === "afterEach" && !manual && setState((prev) => ({ ...prev, status: "running" }));
|
| 706 |
+
},
|
| 707 |
+
[manual, setState]
|
| 708 |
+
), emit = useChannel(
|
| 709 |
+
{
|
| 710 |
+
[EVENTS.RESULT]: handleResult,
|
| 711 |
+
[EVENTS.ERROR]: handleError,
|
| 712 |
+
[EVENTS.SELECT]: handleSelect,
|
| 713 |
+
[STORY_CHANGED]: () => setSelectedItems(/* @__PURE__ */ new Map()),
|
| 714 |
+
[STORY_RENDER_PHASE_CHANGED]: handleReset,
|
| 715 |
+
[STORY_FINISHED]: handleReport,
|
| 716 |
+
[STORY_HOT_UPDATED]: () => {
|
| 717 |
+
setState((prev) => ({ ...prev, status: "running" })), emit(EVENTS.MANUAL, storyId, parameters);
|
| 718 |
+
}
|
| 719 |
+
},
|
| 720 |
+
[handleReset, handleReport, handleSelect, handleError, handleResult, parameters, storyId]
|
| 721 |
+
), handleManual = useCallback(() => {
|
| 722 |
+
setState((prev) => ({ ...prev, status: "running" })), emit(EVENTS.MANUAL, storyId, parameters);
|
| 723 |
+
}, [emit, parameters, setState, storyId]), handleCopyLink = useCallback(async (linkPath) => {
|
| 724 |
+
let { createCopyToClipboardFunction } = await import("storybook/internal/components");
|
| 725 |
+
await createCopyToClipboardFunction()(`${window.location.origin}${linkPath}`);
|
| 726 |
+
}, []), handleJumpToElement = useCallback(
|
| 727 |
+
(target) => emit(SCROLL_INTO_VIEW, target),
|
| 728 |
+
[emit]
|
| 729 |
+
);
|
| 730 |
+
useEffect(() => {
|
| 731 |
+
setState((prev) => ({ ...prev, status: getInitialStatus(manual) }));
|
| 732 |
+
}, [getInitialStatus, manual, setState]);
|
| 733 |
+
let isInitial = status === "initial";
|
| 734 |
+
useEffect(() => {
|
| 735 |
+
a11ySelection && setState((prev) => {
|
| 736 |
+
let update = { ...prev.ui, highlighted: !0 }, [type] = a11ySelection.split(".") ?? [];
|
| 737 |
+
return type && Object.values(RuleType).includes(type) && (update.tab = type), { ...prev, ui: update };
|
| 738 |
+
});
|
| 739 |
+
}, [a11ySelection]), useEffect(() => {
|
| 740 |
+
if (emit(REMOVE_HIGHLIGHT, `${ADDON_ID}/selected`), emit(REMOVE_HIGHLIGHT, `${ADDON_ID}/others`), !ui.highlighted || isInitial)
|
| 741 |
+
return;
|
| 742 |
+
let selected = Array.from(selectedItems.values()).flatMap((key) => {
|
| 743 |
+
let [type, id, number] = key.split(".");
|
| 744 |
+
if (type !== ui.tab)
|
| 745 |
+
return [];
|
| 746 |
+
let target = results?.[type]?.find((r) => r.id === id)?.nodes[Number(number) - 1]?.target;
|
| 747 |
+
return target ? [String(target)] : [];
|
| 748 |
+
});
|
| 749 |
+
selected.length && emit(HIGHLIGHT, {
|
| 750 |
+
id: `${ADDON_ID}/selected`,
|
| 751 |
+
priority: 1,
|
| 752 |
+
selectors: selected,
|
| 753 |
+
styles: {
|
| 754 |
+
outline: `1px solid color-mix(in srgb, ${colorsByType[ui.tab]}, transparent 30%)`,
|
| 755 |
+
backgroundColor: "transparent"
|
| 756 |
+
},
|
| 757 |
+
hoverStyles: {
|
| 758 |
+
outlineWidth: "2px"
|
| 759 |
+
},
|
| 760 |
+
focusStyles: {
|
| 761 |
+
backgroundColor: "transparent"
|
| 762 |
+
},
|
| 763 |
+
menu: results?.[ui.tab].map((result) => {
|
| 764 |
+
let selectors = result.nodes.flatMap((n) => n.target).map(String).filter((e) => selected.includes(e));
|
| 765 |
+
return [
|
| 766 |
+
{
|
| 767 |
+
id: `${ui.tab}.${result.id}:info`,
|
| 768 |
+
title: getTitleForAxeResult(result),
|
| 769 |
+
description: getFriendlySummaryForAxeResult(result),
|
| 770 |
+
selectors
|
| 771 |
+
},
|
| 772 |
+
{
|
| 773 |
+
id: `${ui.tab}.${result.id}`,
|
| 774 |
+
iconLeft: "info",
|
| 775 |
+
iconRight: "shareAlt",
|
| 776 |
+
title: "Learn how to resolve this violation",
|
| 777 |
+
clickEvent: EVENTS.SELECT,
|
| 778 |
+
selectors
|
| 779 |
+
}
|
| 780 |
+
];
|
| 781 |
+
})
|
| 782 |
+
});
|
| 783 |
+
let others = results?.[ui.tab].flatMap((r) => r.nodes.flatMap((n) => n.target).map(String)).filter((e) => ![...unhighlightedSelectors, ...selected].includes(e));
|
| 784 |
+
others?.length && emit(HIGHLIGHT, {
|
| 785 |
+
id: `${ADDON_ID}/others`,
|
| 786 |
+
selectors: others,
|
| 787 |
+
styles: {
|
| 788 |
+
outline: `1px solid color-mix(in srgb, ${colorsByType[ui.tab]}, transparent 30%)`,
|
| 789 |
+
backgroundColor: `color-mix(in srgb, ${colorsByType[ui.tab]}, transparent 60%)`
|
| 790 |
+
},
|
| 791 |
+
hoverStyles: {
|
| 792 |
+
outlineWidth: "2px"
|
| 793 |
+
},
|
| 794 |
+
focusStyles: {
|
| 795 |
+
backgroundColor: "transparent"
|
| 796 |
+
},
|
| 797 |
+
menu: results?.[ui.tab].map((result) => {
|
| 798 |
+
let selectors = result.nodes.flatMap((n) => n.target).map(String).filter((e) => !selected.includes(e));
|
| 799 |
+
return [
|
| 800 |
+
{
|
| 801 |
+
id: `${ui.tab}.${result.id}:info`,
|
| 802 |
+
title: getTitleForAxeResult(result),
|
| 803 |
+
description: getFriendlySummaryForAxeResult(result),
|
| 804 |
+
selectors
|
| 805 |
+
},
|
| 806 |
+
{
|
| 807 |
+
id: `${ui.tab}.${result.id}`,
|
| 808 |
+
iconLeft: "info",
|
| 809 |
+
iconRight: "shareAlt",
|
| 810 |
+
title: "Learn how to resolve this violation",
|
| 811 |
+
clickEvent: EVENTS.SELECT,
|
| 812 |
+
selectors
|
| 813 |
+
}
|
| 814 |
+
];
|
| 815 |
+
})
|
| 816 |
+
});
|
| 817 |
+
}, [isInitial, emit, ui.highlighted, results, ui.tab, selectedItems]);
|
| 818 |
+
let discrepancy = useMemo(() => {
|
| 819 |
+
if (!currentStoryA11yStatusValue)
|
| 820 |
+
return null;
|
| 821 |
+
if (currentStoryA11yStatusValue === "status-value:success" && results?.violations.length)
|
| 822 |
+
return "cliPassedBrowserFailed";
|
| 823 |
+
if (currentStoryA11yStatusValue === "status-value:error" && !results?.violations.length) {
|
| 824 |
+
if (status === "ready" || status === "ran")
|
| 825 |
+
return "browserPassedCliFailed";
|
| 826 |
+
if (status === "manual")
|
| 827 |
+
return "cliFailedButModeManual";
|
| 828 |
+
}
|
| 829 |
+
return null;
|
| 830 |
+
}, [results?.violations.length, status, currentStoryA11yStatusValue]);
|
| 831 |
+
return React.createElement(
|
| 832 |
+
A11yContext.Provider,
|
| 833 |
+
{
|
| 834 |
+
value: {
|
| 835 |
+
parameters,
|
| 836 |
+
results,
|
| 837 |
+
highlighted: ui.highlighted,
|
| 838 |
+
toggleHighlight: handleToggleHighlight,
|
| 839 |
+
tab: ui.tab,
|
| 840 |
+
setTab: useCallback(
|
| 841 |
+
(type) => setState((prev) => ({ ...prev, ui: { ...prev.ui, tab: type } })),
|
| 842 |
+
[setState]
|
| 843 |
+
),
|
| 844 |
+
handleCopyLink,
|
| 845 |
+
status,
|
| 846 |
+
setStatus: useCallback(
|
| 847 |
+
(status2) => setState((prev) => ({ ...prev, status: status2 })),
|
| 848 |
+
[setState]
|
| 849 |
+
),
|
| 850 |
+
error,
|
| 851 |
+
handleManual,
|
| 852 |
+
discrepancy,
|
| 853 |
+
selectedItems,
|
| 854 |
+
toggleOpen,
|
| 855 |
+
allExpanded,
|
| 856 |
+
handleCollapseAll,
|
| 857 |
+
handleExpandAll,
|
| 858 |
+
handleJumpToElement,
|
| 859 |
+
handleSelectionChange
|
| 860 |
+
},
|
| 861 |
+
...props
|
| 862 |
+
}
|
| 863 |
+
);
|
| 864 |
+
}, useA11yContext = () => useContext(A11yContext);
|
| 865 |
+
|
| 866 |
+
// src/components/Report/Report.tsx
|
| 867 |
+
import React3 from "react";
|
| 868 |
+
import { Badge, Button as Button2, EmptyTabContent } from "storybook/internal/components";
|
| 869 |
+
import { ChevronSmallDownIcon } from "@storybook/icons";
|
| 870 |
+
import { styled as styled2 } from "storybook/theming";
|
| 871 |
+
|
| 872 |
+
// src/components/Report/Details.tsx
|
| 873 |
+
import React2, { Fragment, useCallback as useCallback2, useState as useState3 } from "react";
|
| 874 |
+
import { Button, Link, SyntaxHighlighter } from "storybook/internal/components";
|
| 875 |
+
import { CheckIcon, CopyIcon, LocationIcon } from "@storybook/icons";
|
| 876 |
+
|
| 877 |
+
// ../../../node_modules/@babel/runtime/helpers/esm/extends.js
|
| 878 |
+
function _extends() {
|
| 879 |
+
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
| 880 |
+
for (var e = 1; e < arguments.length; e++) {
|
| 881 |
+
var t = arguments[e];
|
| 882 |
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
| 883 |
+
}
|
| 884 |
+
return n;
|
| 885 |
+
}, _extends.apply(null, arguments);
|
| 886 |
+
}
|
| 887 |
+
|
| 888 |
+
// ../../../node_modules/@radix-ui/react-tabs/dist/index.mjs
|
| 889 |
+
import { forwardRef as $1IHzk$forwardRef, createElement as $1IHzk$createElement, useRef as $1IHzk$useRef, useEffect as $1IHzk$useEffect } from "react";
|
| 890 |
+
|
| 891 |
+
// ../../../node_modules/@radix-ui/primitive/dist/index.mjs
|
| 892 |
+
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = !0 } = {}) {
|
| 893 |
+
return function(event) {
|
| 894 |
+
if (originalEventHandler?.(event), checkForDefaultPrevented === !1 || !event.defaultPrevented) return ourEventHandler?.(event);
|
| 895 |
+
};
|
| 896 |
+
}
|
| 897 |
+
|
| 898 |
+
// ../../../node_modules/@radix-ui/react-context/dist/index.mjs
|
| 899 |
+
import { createContext as $3bkAK$createContext, useMemo as $3bkAK$useMemo, createElement as $3bkAK$createElement, useContext as $3bkAK$useContext } from "react";
|
| 900 |
+
function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
| 901 |
+
let defaultContexts = [];
|
| 902 |
+
function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
| 903 |
+
let BaseContext = $3bkAK$createContext(defaultContext), index = defaultContexts.length;
|
| 904 |
+
defaultContexts = [
|
| 905 |
+
...defaultContexts,
|
| 906 |
+
defaultContext
|
| 907 |
+
];
|
| 908 |
+
function Provider(props) {
|
| 909 |
+
let { scope, children, ...context } = props, Context = scope?.[scopeName][index] || BaseContext, value = $3bkAK$useMemo(
|
| 910 |
+
() => context,
|
| 911 |
+
Object.values(context)
|
| 912 |
+
);
|
| 913 |
+
return $3bkAK$createElement(Context.Provider, {
|
| 914 |
+
value
|
| 915 |
+
}, children);
|
| 916 |
+
}
|
| 917 |
+
function useContext2(consumerName, scope) {
|
| 918 |
+
let Context = scope?.[scopeName][index] || BaseContext, context = $3bkAK$useContext(Context);
|
| 919 |
+
if (context) return context;
|
| 920 |
+
if (defaultContext !== void 0) return defaultContext;
|
| 921 |
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
| 922 |
+
}
|
| 923 |
+
return Provider.displayName = rootComponentName + "Provider", [
|
| 924 |
+
Provider,
|
| 925 |
+
useContext2
|
| 926 |
+
];
|
| 927 |
+
}
|
| 928 |
+
let createScope = () => {
|
| 929 |
+
let scopeContexts = defaultContexts.map((defaultContext) => $3bkAK$createContext(defaultContext));
|
| 930 |
+
return function(scope) {
|
| 931 |
+
let contexts = scope?.[scopeName] || scopeContexts;
|
| 932 |
+
return $3bkAK$useMemo(
|
| 933 |
+
() => ({
|
| 934 |
+
[`__scope${scopeName}`]: {
|
| 935 |
+
...scope,
|
| 936 |
+
[scopeName]: contexts
|
| 937 |
+
}
|
| 938 |
+
}),
|
| 939 |
+
[
|
| 940 |
+
scope,
|
| 941 |
+
contexts
|
| 942 |
+
]
|
| 943 |
+
);
|
| 944 |
+
};
|
| 945 |
+
};
|
| 946 |
+
return createScope.scopeName = scopeName, [
|
| 947 |
+
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
| 948 |
+
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
| 949 |
+
];
|
| 950 |
+
}
|
| 951 |
+
function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
| 952 |
+
let baseScope = scopes[0];
|
| 953 |
+
if (scopes.length === 1) return baseScope;
|
| 954 |
+
let createScope1 = () => {
|
| 955 |
+
let scopeHooks = scopes.map(
|
| 956 |
+
(createScope) => ({
|
| 957 |
+
useScope: createScope(),
|
| 958 |
+
scopeName: createScope.scopeName
|
| 959 |
+
})
|
| 960 |
+
);
|
| 961 |
+
return function(overrideScopes) {
|
| 962 |
+
let nextScopes1 = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {
|
| 963 |
+
let currentScope = useScope(overrideScopes)[`__scope${scopeName}`];
|
| 964 |
+
return {
|
| 965 |
+
...nextScopes,
|
| 966 |
+
...currentScope
|
| 967 |
+
};
|
| 968 |
+
}, {});
|
| 969 |
+
return $3bkAK$useMemo(
|
| 970 |
+
() => ({
|
| 971 |
+
[`__scope${baseScope.scopeName}`]: nextScopes1
|
| 972 |
+
}),
|
| 973 |
+
[
|
| 974 |
+
nextScopes1
|
| 975 |
+
]
|
| 976 |
+
);
|
| 977 |
+
};
|
| 978 |
+
};
|
| 979 |
+
return createScope1.scopeName = baseScope.scopeName, createScope1;
|
| 980 |
+
}
|
| 981 |
+
|
| 982 |
+
// ../../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
| 983 |
+
import { forwardRef as $98Iye$forwardRef, createElement as $98Iye$createElement, useRef as $98Iye$useRef, useState as $98Iye$useState, useEffect as $98Iye$useEffect, useCallback as $98Iye$useCallback } from "react";
|
| 984 |
+
|
| 985 |
+
// ../../../node_modules/@radix-ui/react-collection/dist/index.mjs
|
| 986 |
+
import $6vYhU$react from "react";
|
| 987 |
+
|
| 988 |
+
// ../../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
| 989 |
+
import { useCallback as $3vqmr$useCallback } from "react";
|
| 990 |
+
function $6ed0406888f73fc4$var$setRef(ref, value) {
|
| 991 |
+
typeof ref == "function" ? ref(value) : ref != null && (ref.current = value);
|
| 992 |
+
}
|
| 993 |
+
function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
| 994 |
+
return (node) => refs.forEach(
|
| 995 |
+
(ref) => $6ed0406888f73fc4$var$setRef(ref, node)
|
| 996 |
+
);
|
| 997 |
+
}
|
| 998 |
+
function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
| 999 |
+
return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
| 1000 |
+
}
|
| 1001 |
+
|
| 1002 |
+
// ../../../node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.mjs
|
| 1003 |
+
import { forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment } from "react";
|
| 1004 |
+
var $5e63c961fc1ce211$export$8c6ed5c666ac1360 = $9IrjX$forwardRef((props, forwardedRef) => {
|
| 1005 |
+
let { children, ...slotProps } = props, childrenArray = $9IrjX$Children.toArray(children), slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
| 1006 |
+
if (slottable) {
|
| 1007 |
+
let newElement = slottable.props.children, newChildren = childrenArray.map((child) => child === slottable ? $9IrjX$Children.count(newElement) > 1 ? $9IrjX$Children.only(null) : $9IrjX$isValidElement(newElement) ? newElement.props.children : null : child);
|
| 1008 |
+
return $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
| 1009 |
+
ref: forwardedRef
|
| 1010 |
+
}), $9IrjX$isValidElement(newElement) ? $9IrjX$cloneElement(newElement, void 0, newChildren) : null);
|
| 1011 |
+
}
|
| 1012 |
+
return $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
| 1013 |
+
ref: forwardedRef
|
| 1014 |
+
}), children);
|
| 1015 |
+
});
|
| 1016 |
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = "Slot";
|
| 1017 |
+
var $5e63c961fc1ce211$var$SlotClone = $9IrjX$forwardRef((props, forwardedRef) => {
|
| 1018 |
+
let { children, ...slotProps } = props;
|
| 1019 |
+
return $9IrjX$isValidElement(children) ? $9IrjX$cloneElement(children, {
|
| 1020 |
+
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
| 1021 |
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
| 1022 |
+
}) : $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;
|
| 1023 |
+
});
|
| 1024 |
+
$5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
|
| 1025 |
+
var $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children }) => $9IrjX$createElement($9IrjX$Fragment, null, children);
|
| 1026 |
+
function $5e63c961fc1ce211$var$isSlottable(child) {
|
| 1027 |
+
return $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
| 1028 |
+
}
|
| 1029 |
+
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
| 1030 |
+
let overrideProps = {
|
| 1031 |
+
...childProps
|
| 1032 |
+
};
|
| 1033 |
+
for (let propName in childProps) {
|
| 1034 |
+
let slotPropValue = slotProps[propName], childPropValue = childProps[propName];
|
| 1035 |
+
/^on[A-Z]/.test(propName) ? slotPropValue && childPropValue ? overrideProps[propName] = (...args) => {
|
| 1036 |
+
childPropValue(...args), slotPropValue(...args);
|
| 1037 |
+
} : slotPropValue && (overrideProps[propName] = slotPropValue) : propName === "style" ? overrideProps[propName] = {
|
| 1038 |
+
...slotPropValue,
|
| 1039 |
+
...childPropValue
|
| 1040 |
+
} : propName === "className" && (overrideProps[propName] = [
|
| 1041 |
+
slotPropValue,
|
| 1042 |
+
childPropValue
|
| 1043 |
+
].filter(Boolean).join(" "));
|
| 1044 |
+
}
|
| 1045 |
+
return {
|
| 1046 |
+
...slotProps,
|
| 1047 |
+
...overrideProps
|
| 1048 |
+
};
|
| 1049 |
+
}
|
| 1050 |
+
|
| 1051 |
+
// ../../../node_modules/@radix-ui/react-collection/dist/index.mjs
|
| 1052 |
+
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
| 1053 |
+
let PROVIDER_NAME = name + "CollectionProvider", [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME), [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
| 1054 |
+
collectionRef: {
|
| 1055 |
+
current: null
|
| 1056 |
+
},
|
| 1057 |
+
itemMap: /* @__PURE__ */ new Map()
|
| 1058 |
+
}), CollectionProvider = (props) => {
|
| 1059 |
+
let { scope, children } = props, ref = $6vYhU$react.useRef(null), itemMap = $6vYhU$react.useRef(/* @__PURE__ */ new Map()).current;
|
| 1060 |
+
return $6vYhU$react.createElement(CollectionProviderImpl, {
|
| 1061 |
+
scope,
|
| 1062 |
+
itemMap,
|
| 1063 |
+
collectionRef: ref
|
| 1064 |
+
}, children);
|
| 1065 |
+
};
|
| 1066 |
+
Object.assign(CollectionProvider, {
|
| 1067 |
+
displayName: PROVIDER_NAME
|
| 1068 |
+
});
|
| 1069 |
+
let COLLECTION_SLOT_NAME = name + "CollectionSlot", CollectionSlot = $6vYhU$react.forwardRef((props, forwardedRef) => {
|
| 1070 |
+
let { scope, children } = props, context = useCollectionContext(COLLECTION_SLOT_NAME, scope), composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
| 1071 |
+
return $6vYhU$react.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
| 1072 |
+
ref: composedRefs
|
| 1073 |
+
}, children);
|
| 1074 |
+
});
|
| 1075 |
+
Object.assign(CollectionSlot, {
|
| 1076 |
+
displayName: COLLECTION_SLOT_NAME
|
| 1077 |
+
});
|
| 1078 |
+
let ITEM_SLOT_NAME = name + "CollectionItemSlot", ITEM_DATA_ATTR = "data-radix-collection-item", CollectionItemSlot = $6vYhU$react.forwardRef((props, forwardedRef) => {
|
| 1079 |
+
let { scope, children, ...itemData } = props, ref = $6vYhU$react.useRef(null), composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref), context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
| 1080 |
+
return $6vYhU$react.useEffect(() => (context.itemMap.set(ref, {
|
| 1081 |
+
ref,
|
| 1082 |
+
...itemData
|
| 1083 |
+
}), () => void context.itemMap.delete(ref))), $6vYhU$react.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
| 1084 |
+
[ITEM_DATA_ATTR]: "",
|
| 1085 |
+
ref: composedRefs
|
| 1086 |
+
}, children);
|
| 1087 |
+
});
|
| 1088 |
+
Object.assign(CollectionItemSlot, {
|
| 1089 |
+
displayName: ITEM_SLOT_NAME
|
| 1090 |
+
});
|
| 1091 |
+
function useCollection(scope) {
|
| 1092 |
+
let context = useCollectionContext(name + "CollectionConsumer", scope);
|
| 1093 |
+
return $6vYhU$react.useCallback(() => {
|
| 1094 |
+
let collectionNode = context.collectionRef.current;
|
| 1095 |
+
if (!collectionNode) return [];
|
| 1096 |
+
let orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
| 1097 |
+
return Array.from(context.itemMap.values()).sort(
|
| 1098 |
+
(a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
| 1099 |
+
);
|
| 1100 |
+
}, [
|
| 1101 |
+
context.collectionRef,
|
| 1102 |
+
context.itemMap
|
| 1103 |
+
]);
|
| 1104 |
+
}
|
| 1105 |
+
return [
|
| 1106 |
+
{
|
| 1107 |
+
Provider: CollectionProvider,
|
| 1108 |
+
Slot: CollectionSlot,
|
| 1109 |
+
ItemSlot: CollectionItemSlot
|
| 1110 |
+
},
|
| 1111 |
+
useCollection,
|
| 1112 |
+
createCollectionScope
|
| 1113 |
+
];
|
| 1114 |
+
}
|
| 1115 |
+
|
| 1116 |
+
// ../../../node_modules/@radix-ui/react-id/dist/index.mjs
|
| 1117 |
+
import * as $2AODx$react from "react";
|
| 1118 |
+
|
| 1119 |
+
// ../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
| 1120 |
+
import { useLayoutEffect as $dxlwH$useLayoutEffect } from "react";
|
| 1121 |
+
var $9f79659886946c16$export$e5c5a5f917a5871c = globalThis?.document ? $dxlwH$useLayoutEffect : () => {
|
| 1122 |
+
};
|
| 1123 |
+
|
| 1124 |
+
// ../../../node_modules/@radix-ui/react-id/dist/index.mjs
|
| 1125 |
+
var $1746a345f3d73bb7$var$useReactId = $2AODx$react.useId || (() => {
|
| 1126 |
+
}), $1746a345f3d73bb7$var$count = 0;
|
| 1127 |
+
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
| 1128 |
+
let [id, setId] = $2AODx$react.useState($1746a345f3d73bb7$var$useReactId());
|
| 1129 |
+
return $9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
| 1130 |
+
deterministicId || setId(
|
| 1131 |
+
(reactId) => reactId ?? String($1746a345f3d73bb7$var$count++)
|
| 1132 |
+
);
|
| 1133 |
+
}, [
|
| 1134 |
+
deterministicId
|
| 1135 |
+
]), deterministicId || (id ? `radix-${id}` : "");
|
| 1136 |
+
}
|
| 1137 |
+
|
| 1138 |
+
// ../../../node_modules/@radix-ui/react-primitive/dist/index.mjs
|
| 1139 |
+
import { forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement } from "react";
|
| 1140 |
+
import { flushSync as $4q5Fq$flushSync } from "react-dom";
|
| 1141 |
+
|
| 1142 |
+
// ../../../node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.mjs
|
| 1143 |
+
import { forwardRef as $9IrjX$forwardRef2, Children as $9IrjX$Children2, isValidElement as $9IrjX$isValidElement2, createElement as $9IrjX$createElement2, cloneElement as $9IrjX$cloneElement2, Fragment as $9IrjX$Fragment2 } from "react";
|
| 1144 |
+
var $5e63c961fc1ce211$export$8c6ed5c666ac13602 = $9IrjX$forwardRef2((props, forwardedRef) => {
|
| 1145 |
+
let { children, ...slotProps } = props, childrenArray = $9IrjX$Children2.toArray(children), slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable2);
|
| 1146 |
+
if (slottable) {
|
| 1147 |
+
let newElement = slottable.props.children, newChildren = childrenArray.map((child) => child === slottable ? $9IrjX$Children2.count(newElement) > 1 ? $9IrjX$Children2.only(null) : $9IrjX$isValidElement2(newElement) ? newElement.props.children : null : child);
|
| 1148 |
+
return $9IrjX$createElement2($5e63c961fc1ce211$var$SlotClone2, _extends({}, slotProps, {
|
| 1149 |
+
ref: forwardedRef
|
| 1150 |
+
}), $9IrjX$isValidElement2(newElement) ? $9IrjX$cloneElement2(newElement, void 0, newChildren) : null);
|
| 1151 |
+
}
|
| 1152 |
+
return $9IrjX$createElement2($5e63c961fc1ce211$var$SlotClone2, _extends({}, slotProps, {
|
| 1153 |
+
ref: forwardedRef
|
| 1154 |
+
}), children);
|
| 1155 |
+
});
|
| 1156 |
+
$5e63c961fc1ce211$export$8c6ed5c666ac13602.displayName = "Slot";
|
| 1157 |
+
var $5e63c961fc1ce211$var$SlotClone2 = $9IrjX$forwardRef2((props, forwardedRef) => {
|
| 1158 |
+
let { children, ...slotProps } = props;
|
| 1159 |
+
return $9IrjX$isValidElement2(children) ? $9IrjX$cloneElement2(children, {
|
| 1160 |
+
...$5e63c961fc1ce211$var$mergeProps2(slotProps, children.props),
|
| 1161 |
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
| 1162 |
+
}) : $9IrjX$Children2.count(children) > 1 ? $9IrjX$Children2.only(null) : null;
|
| 1163 |
+
});
|
| 1164 |
+
$5e63c961fc1ce211$var$SlotClone2.displayName = "SlotClone";
|
| 1165 |
+
var $5e63c961fc1ce211$export$d9f1ccf0bdb05d452 = ({ children }) => $9IrjX$createElement2($9IrjX$Fragment2, null, children);
|
| 1166 |
+
function $5e63c961fc1ce211$var$isSlottable2(child) {
|
| 1167 |
+
return $9IrjX$isValidElement2(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d452;
|
| 1168 |
+
}
|
| 1169 |
+
function $5e63c961fc1ce211$var$mergeProps2(slotProps, childProps) {
|
| 1170 |
+
let overrideProps = {
|
| 1171 |
+
...childProps
|
| 1172 |
+
};
|
| 1173 |
+
for (let propName in childProps) {
|
| 1174 |
+
let slotPropValue = slotProps[propName], childPropValue = childProps[propName];
|
| 1175 |
+
/^on[A-Z]/.test(propName) ? slotPropValue && childPropValue ? overrideProps[propName] = (...args) => {
|
| 1176 |
+
childPropValue(...args), slotPropValue(...args);
|
| 1177 |
+
} : slotPropValue && (overrideProps[propName] = slotPropValue) : propName === "style" ? overrideProps[propName] = {
|
| 1178 |
+
...slotPropValue,
|
| 1179 |
+
...childPropValue
|
| 1180 |
+
} : propName === "className" && (overrideProps[propName] = [
|
| 1181 |
+
slotPropValue,
|
| 1182 |
+
childPropValue
|
| 1183 |
+
].filter(Boolean).join(" "));
|
| 1184 |
+
}
|
| 1185 |
+
return {
|
| 1186 |
+
...slotProps,
|
| 1187 |
+
...overrideProps
|
| 1188 |
+
};
|
| 1189 |
+
}
|
| 1190 |
+
|
| 1191 |
+
// ../../../node_modules/@radix-ui/react-primitive/dist/index.mjs
|
| 1192 |
+
var $8927f6f2acc4f386$var$NODES = [
|
| 1193 |
+
"a",
|
| 1194 |
+
"button",
|
| 1195 |
+
"div",
|
| 1196 |
+
"form",
|
| 1197 |
+
"h2",
|
| 1198 |
+
"h3",
|
| 1199 |
+
"img",
|
| 1200 |
+
"input",
|
| 1201 |
+
"label",
|
| 1202 |
+
"li",
|
| 1203 |
+
"nav",
|
| 1204 |
+
"ol",
|
| 1205 |
+
"p",
|
| 1206 |
+
"span",
|
| 1207 |
+
"svg",
|
| 1208 |
+
"ul"
|
| 1209 |
+
], $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node) => {
|
| 1210 |
+
let Node = $4q5Fq$forwardRef((props, forwardedRef) => {
|
| 1211 |
+
let { asChild, ...primitiveProps } = props, Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac13602 : node;
|
| 1212 |
+
return $4q5Fq$useEffect(() => {
|
| 1213 |
+
window[Symbol.for("radix-ui")] = !0;
|
| 1214 |
+
}, []), $4q5Fq$createElement(Comp, _extends({}, primitiveProps, {
|
| 1215 |
+
ref: forwardedRef
|
| 1216 |
+
}));
|
| 1217 |
+
});
|
| 1218 |
+
return Node.displayName = `Primitive.${node}`, {
|
| 1219 |
+
...primitive,
|
| 1220 |
+
[node]: Node
|
| 1221 |
+
};
|
| 1222 |
+
}, {});
|
| 1223 |
+
|
| 1224 |
+
// ../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
| 1225 |
+
import { useRef as $lwiWj$useRef, useEffect as $lwiWj$useEffect, useMemo as $lwiWj$useMemo } from "react";
|
| 1226 |
+
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
| 1227 |
+
let callbackRef = $lwiWj$useRef(callback);
|
| 1228 |
+
return $lwiWj$useEffect(() => {
|
| 1229 |
+
callbackRef.current = callback;
|
| 1230 |
+
}), $lwiWj$useMemo(
|
| 1231 |
+
() => (...args) => {
|
| 1232 |
+
var _callbackRef$current;
|
| 1233 |
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
| 1234 |
+
},
|
| 1235 |
+
[]
|
| 1236 |
+
);
|
| 1237 |
+
}
|
| 1238 |
+
|
| 1239 |
+
// ../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
| 1240 |
+
import { useCallback as $bnPw9$useCallback, useState as $bnPw9$useState, useRef as $bnPw9$useRef, useEffect as $bnPw9$useEffect } from "react";
|
| 1241 |
+
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange = () => {
|
| 1242 |
+
} }) {
|
| 1243 |
+
let [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
| 1244 |
+
defaultProp,
|
| 1245 |
+
onChange
|
| 1246 |
+
}), isControlled = prop !== void 0, value1 = isControlled ? prop : uncontrolledProp, handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange), setValue = $bnPw9$useCallback((nextValue) => {
|
| 1247 |
+
if (isControlled) {
|
| 1248 |
+
let value = typeof nextValue == "function" ? nextValue(prop) : nextValue;
|
| 1249 |
+
value !== prop && handleChange(value);
|
| 1250 |
+
} else setUncontrolledProp(nextValue);
|
| 1251 |
+
}, [
|
| 1252 |
+
isControlled,
|
| 1253 |
+
prop,
|
| 1254 |
+
setUncontrolledProp,
|
| 1255 |
+
handleChange
|
| 1256 |
+
]);
|
| 1257 |
+
return [
|
| 1258 |
+
value1,
|
| 1259 |
+
setValue
|
| 1260 |
+
];
|
| 1261 |
+
}
|
| 1262 |
+
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp, onChange }) {
|
| 1263 |
+
let uncontrolledState = $bnPw9$useState(defaultProp), [value] = uncontrolledState, prevValueRef = $bnPw9$useRef(value), handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
| 1264 |
+
return $bnPw9$useEffect(() => {
|
| 1265 |
+
prevValueRef.current !== value && (handleChange(value), prevValueRef.current = value);
|
| 1266 |
+
}, [
|
| 1267 |
+
value,
|
| 1268 |
+
prevValueRef,
|
| 1269 |
+
handleChange
|
| 1270 |
+
]), uncontrolledState;
|
| 1271 |
+
}
|
| 1272 |
+
|
| 1273 |
+
// ../../../node_modules/@radix-ui/react-direction/dist/index.mjs
|
| 1274 |
+
import { createContext as $7Gjcd$createContext, createElement as $7Gjcd$createElement, useContext as $7Gjcd$useContext } from "react";
|
| 1275 |
+
var $f631663db3294ace$var$DirectionContext = $7Gjcd$createContext(void 0);
|
| 1276 |
+
function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
|
| 1277 |
+
let globalDir = $7Gjcd$useContext($f631663db3294ace$var$DirectionContext);
|
| 1278 |
+
return localDir || globalDir || "ltr";
|
| 1279 |
+
}
|
| 1280 |
+
|
| 1281 |
+
// ../../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs
|
| 1282 |
+
var $d7bdfb9eb0fdf311$var$ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus", $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {
|
| 1283 |
+
bubbles: !1,
|
| 1284 |
+
cancelable: !0
|
| 1285 |
+
}, $d7bdfb9eb0fdf311$var$GROUP_NAME = "RovingFocusGroup", [$d7bdfb9eb0fdf311$var$Collection, $d7bdfb9eb0fdf311$var$useCollection, $d7bdfb9eb0fdf311$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME), [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME, [
|
| 1286 |
+
$d7bdfb9eb0fdf311$var$createCollectionScope
|
| 1287 |
+
]), [$d7bdfb9eb0fdf311$var$RovingFocusProvider, $d7bdfb9eb0fdf311$var$useRovingFocusContext] = $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME), $d7bdfb9eb0fdf311$export$8699f7c8af148338 = $98Iye$forwardRef((props, forwardedRef) => $98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.Provider, {
|
| 1288 |
+
scope: props.__scopeRovingFocusGroup
|
| 1289 |
+
}, $98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.Slot, {
|
| 1290 |
+
scope: props.__scopeRovingFocusGroup
|
| 1291 |
+
}, $98Iye$createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends({}, props, {
|
| 1292 |
+
ref: forwardedRef
|
| 1293 |
+
})))));
|
| 1294 |
+
Object.assign($d7bdfb9eb0fdf311$export$8699f7c8af148338, {
|
| 1295 |
+
displayName: $d7bdfb9eb0fdf311$var$GROUP_NAME
|
| 1296 |
+
});
|
| 1297 |
+
var $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = $98Iye$forwardRef((props, forwardedRef) => {
|
| 1298 |
+
let { __scopeRovingFocusGroup, orientation, loop = !1, dir, currentTabStopId: currentTabStopIdProp, defaultCurrentTabStopId, onCurrentTabStopIdChange, onEntryFocus, ...groupProps } = props, ref = $98Iye$useRef(null), composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref), direction = $f631663db3294ace$export$b39126d51d94e6f3(dir), [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
| 1299 |
+
prop: currentTabStopIdProp,
|
| 1300 |
+
defaultProp: defaultCurrentTabStopId,
|
| 1301 |
+
onChange: onCurrentTabStopIdChange
|
| 1302 |
+
}), [isTabbingBackOut, setIsTabbingBackOut] = $98Iye$useState(!1), handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEntryFocus), getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup), isClickFocusRef = $98Iye$useRef(!1), [focusableItemsCount, setFocusableItemsCount] = $98Iye$useState(0);
|
| 1303 |
+
return $98Iye$useEffect(() => {
|
| 1304 |
+
let node = ref.current;
|
| 1305 |
+
if (node)
|
| 1306 |
+
return node.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus), () => node.removeEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus);
|
| 1307 |
+
}, [
|
| 1308 |
+
handleEntryFocus
|
| 1309 |
+
]), $98Iye$createElement($d7bdfb9eb0fdf311$var$RovingFocusProvider, {
|
| 1310 |
+
scope: __scopeRovingFocusGroup,
|
| 1311 |
+
orientation,
|
| 1312 |
+
dir: direction,
|
| 1313 |
+
loop,
|
| 1314 |
+
currentTabStopId,
|
| 1315 |
+
onItemFocus: $98Iye$useCallback(
|
| 1316 |
+
(tabStopId) => setCurrentTabStopId(tabStopId),
|
| 1317 |
+
[
|
| 1318 |
+
setCurrentTabStopId
|
| 1319 |
+
]
|
| 1320 |
+
),
|
| 1321 |
+
onItemShiftTab: $98Iye$useCallback(
|
| 1322 |
+
() => setIsTabbingBackOut(!0),
|
| 1323 |
+
[]
|
| 1324 |
+
),
|
| 1325 |
+
onFocusableItemAdd: $98Iye$useCallback(
|
| 1326 |
+
() => setFocusableItemsCount(
|
| 1327 |
+
(prevCount) => prevCount + 1
|
| 1328 |
+
),
|
| 1329 |
+
[]
|
| 1330 |
+
),
|
| 1331 |
+
onFocusableItemRemove: $98Iye$useCallback(
|
| 1332 |
+
() => setFocusableItemsCount(
|
| 1333 |
+
(prevCount) => prevCount - 1
|
| 1334 |
+
),
|
| 1335 |
+
[]
|
| 1336 |
+
)
|
| 1337 |
+
}, $98Iye$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
| 1338 |
+
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
| 1339 |
+
"data-orientation": orientation
|
| 1340 |
+
}, groupProps, {
|
| 1341 |
+
ref: composedRefs,
|
| 1342 |
+
style: {
|
| 1343 |
+
outline: "none",
|
| 1344 |
+
...props.style
|
| 1345 |
+
},
|
| 1346 |
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, () => {
|
| 1347 |
+
isClickFocusRef.current = !0;
|
| 1348 |
+
}),
|
| 1349 |
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, (event) => {
|
| 1350 |
+
let isKeyboardFocus = !isClickFocusRef.current;
|
| 1351 |
+
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
| 1352 |
+
let entryFocusEvent = new CustomEvent($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, $d7bdfb9eb0fdf311$var$EVENT_OPTIONS);
|
| 1353 |
+
if (event.currentTarget.dispatchEvent(entryFocusEvent), !entryFocusEvent.defaultPrevented) {
|
| 1354 |
+
let items = getItems().filter(
|
| 1355 |
+
(item) => item.focusable
|
| 1356 |
+
), activeItem = items.find(
|
| 1357 |
+
(item) => item.active
|
| 1358 |
+
), currentItem = items.find(
|
| 1359 |
+
(item) => item.id === currentTabStopId
|
| 1360 |
+
), candidateNodes = [
|
| 1361 |
+
activeItem,
|
| 1362 |
+
currentItem,
|
| 1363 |
+
...items
|
| 1364 |
+
].filter(Boolean).map(
|
| 1365 |
+
(item) => item.ref.current
|
| 1366 |
+
);
|
| 1367 |
+
$d7bdfb9eb0fdf311$var$focusFirst(candidateNodes);
|
| 1368 |
+
}
|
| 1369 |
+
}
|
| 1370 |
+
isClickFocusRef.current = !1;
|
| 1371 |
+
}),
|
| 1372 |
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(
|
| 1373 |
+
props.onBlur,
|
| 1374 |
+
() => setIsTabbingBackOut(!1)
|
| 1375 |
+
)
|
| 1376 |
+
})));
|
| 1377 |
+
}), $d7bdfb9eb0fdf311$var$ITEM_NAME = "RovingFocusGroupItem", $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = $98Iye$forwardRef((props, forwardedRef) => {
|
| 1378 |
+
let { __scopeRovingFocusGroup, focusable = !0, active = !1, tabStopId, ...itemProps } = props, autoId = $1746a345f3d73bb7$export$f680877a34711e37(), id = tabStopId || autoId, context = $d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME, __scopeRovingFocusGroup), isCurrentTabStop = context.currentTabStopId === id, getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup), { onFocusableItemAdd, onFocusableItemRemove } = context;
|
| 1379 |
+
return $98Iye$useEffect(() => {
|
| 1380 |
+
if (focusable)
|
| 1381 |
+
return onFocusableItemAdd(), () => onFocusableItemRemove();
|
| 1382 |
+
}, [
|
| 1383 |
+
focusable,
|
| 1384 |
+
onFocusableItemAdd,
|
| 1385 |
+
onFocusableItemRemove
|
| 1386 |
+
]), $98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.ItemSlot, {
|
| 1387 |
+
scope: __scopeRovingFocusGroup,
|
| 1388 |
+
id,
|
| 1389 |
+
focusable,
|
| 1390 |
+
active
|
| 1391 |
+
}, $98Iye$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
| 1392 |
+
tabIndex: isCurrentTabStop ? 0 : -1,
|
| 1393 |
+
"data-orientation": context.orientation
|
| 1394 |
+
}, itemProps, {
|
| 1395 |
+
ref: forwardedRef,
|
| 1396 |
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event) => {
|
| 1397 |
+
focusable ? context.onItemFocus(id) : event.preventDefault();
|
| 1398 |
+
}),
|
| 1399 |
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(
|
| 1400 |
+
props.onFocus,
|
| 1401 |
+
() => context.onItemFocus(id)
|
| 1402 |
+
),
|
| 1403 |
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
|
| 1404 |
+
if (event.key === "Tab" && event.shiftKey) {
|
| 1405 |
+
context.onItemShiftTab();
|
| 1406 |
+
return;
|
| 1407 |
+
}
|
| 1408 |
+
if (event.target !== event.currentTarget) return;
|
| 1409 |
+
let focusIntent = $d7bdfb9eb0fdf311$var$getFocusIntent(event, context.orientation, context.dir);
|
| 1410 |
+
if (focusIntent !== void 0) {
|
| 1411 |
+
event.preventDefault();
|
| 1412 |
+
let candidateNodes = getItems().filter(
|
| 1413 |
+
(item) => item.focusable
|
| 1414 |
+
).map(
|
| 1415 |
+
(item) => item.ref.current
|
| 1416 |
+
);
|
| 1417 |
+
if (focusIntent === "last") candidateNodes.reverse();
|
| 1418 |
+
else if (focusIntent === "prev" || focusIntent === "next") {
|
| 1419 |
+
focusIntent === "prev" && candidateNodes.reverse();
|
| 1420 |
+
let currentIndex = candidateNodes.indexOf(event.currentTarget);
|
| 1421 |
+
candidateNodes = context.loop ? $d7bdfb9eb0fdf311$var$wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
| 1422 |
+
}
|
| 1423 |
+
setTimeout(
|
| 1424 |
+
() => $d7bdfb9eb0fdf311$var$focusFirst(candidateNodes)
|
| 1425 |
+
);
|
| 1426 |
+
}
|
| 1427 |
+
})
|
| 1428 |
+
})));
|
| 1429 |
+
});
|
| 1430 |
+
Object.assign($d7bdfb9eb0fdf311$export$ab9df7c53fe8454, {
|
| 1431 |
+
displayName: $d7bdfb9eb0fdf311$var$ITEM_NAME
|
| 1432 |
+
});
|
| 1433 |
+
var $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT = {
|
| 1434 |
+
ArrowLeft: "prev",
|
| 1435 |
+
ArrowUp: "prev",
|
| 1436 |
+
ArrowRight: "next",
|
| 1437 |
+
ArrowDown: "next",
|
| 1438 |
+
PageUp: "first",
|
| 1439 |
+
Home: "first",
|
| 1440 |
+
PageDown: "last",
|
| 1441 |
+
End: "last"
|
| 1442 |
+
};
|
| 1443 |
+
function $d7bdfb9eb0fdf311$var$getDirectionAwareKey(key, dir) {
|
| 1444 |
+
return dir !== "rtl" ? key : key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
|
| 1445 |
+
}
|
| 1446 |
+
function $d7bdfb9eb0fdf311$var$getFocusIntent(event, orientation, dir) {
|
| 1447 |
+
let key = $d7bdfb9eb0fdf311$var$getDirectionAwareKey(event.key, dir);
|
| 1448 |
+
if (!(orientation === "vertical" && [
|
| 1449 |
+
"ArrowLeft",
|
| 1450 |
+
"ArrowRight"
|
| 1451 |
+
].includes(key)) && !(orientation === "horizontal" && [
|
| 1452 |
+
"ArrowUp",
|
| 1453 |
+
"ArrowDown"
|
| 1454 |
+
].includes(key)))
|
| 1455 |
+
return $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT[key];
|
| 1456 |
+
}
|
| 1457 |
+
function $d7bdfb9eb0fdf311$var$focusFirst(candidates) {
|
| 1458 |
+
let PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
| 1459 |
+
for (let candidate of candidates)
|
| 1460 |
+
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT || (candidate.focus(), document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT)) return;
|
| 1461 |
+
}
|
| 1462 |
+
function $d7bdfb9eb0fdf311$var$wrapArray(array, startIndex) {
|
| 1463 |
+
return array.map(
|
| 1464 |
+
(_, index) => array[(startIndex + index) % array.length]
|
| 1465 |
+
);
|
| 1466 |
+
}
|
| 1467 |
+
var $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9 = $d7bdfb9eb0fdf311$export$8699f7c8af148338, $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df7c53fe8454;
|
| 1468 |
+
|
| 1469 |
+
// ../../../node_modules/@radix-ui/react-presence/dist/index.mjs
|
| 1470 |
+
import { Children as $iqq3r$Children, cloneElement as $iqq3r$cloneElement, useState as $iqq3r$useState, useRef as $iqq3r$useRef, useEffect as $iqq3r$useEffect, useCallback as $iqq3r$useCallback, useReducer as $iqq3r$useReducer } from "react";
|
| 1471 |
+
import { flushSync as $iqq3r$flushSync } from "react-dom";
|
| 1472 |
+
function $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {
|
| 1473 |
+
return $iqq3r$useReducer((state, event) => {
|
| 1474 |
+
let nextState = machine[state][event];
|
| 1475 |
+
return nextState ?? state;
|
| 1476 |
+
}, initialState);
|
| 1477 |
+
}
|
| 1478 |
+
var $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props) => {
|
| 1479 |
+
let { present, children } = props, presence = $921a889cee6df7e8$var$usePresence(present), child = typeof children == "function" ? children({
|
| 1480 |
+
present: presence.isPresent
|
| 1481 |
+
}) : $iqq3r$Children.only(children), ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(presence.ref, child.ref);
|
| 1482 |
+
return typeof children == "function" || presence.isPresent ? $iqq3r$cloneElement(child, {
|
| 1483 |
+
ref
|
| 1484 |
+
}) : null;
|
| 1485 |
+
};
|
| 1486 |
+
$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = "Presence";
|
| 1487 |
+
function $921a889cee6df7e8$var$usePresence(present) {
|
| 1488 |
+
let [node1, setNode] = $iqq3r$useState(), stylesRef = $iqq3r$useRef({}), prevPresentRef = $iqq3r$useRef(present), prevAnimationNameRef = $iqq3r$useRef("none"), initialState = present ? "mounted" : "unmounted", [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {
|
| 1489 |
+
mounted: {
|
| 1490 |
+
UNMOUNT: "unmounted",
|
| 1491 |
+
ANIMATION_OUT: "unmountSuspended"
|
| 1492 |
+
},
|
| 1493 |
+
unmountSuspended: {
|
| 1494 |
+
MOUNT: "mounted",
|
| 1495 |
+
ANIMATION_END: "unmounted"
|
| 1496 |
+
},
|
| 1497 |
+
unmounted: {
|
| 1498 |
+
MOUNT: "mounted"
|
| 1499 |
+
}
|
| 1500 |
+
});
|
| 1501 |
+
return $iqq3r$useEffect(() => {
|
| 1502 |
+
let currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);
|
| 1503 |
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
| 1504 |
+
}, [
|
| 1505 |
+
state
|
| 1506 |
+
]), $9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
| 1507 |
+
let styles = stylesRef.current, wasPresent = prevPresentRef.current;
|
| 1508 |
+
if (wasPresent !== present) {
|
| 1509 |
+
let prevAnimationName = prevAnimationNameRef.current, currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);
|
| 1510 |
+
present ? send("MOUNT") : currentAnimationName === "none" || styles?.display === "none" ? send("UNMOUNT") : send(wasPresent && prevAnimationName !== currentAnimationName ? "ANIMATION_OUT" : "UNMOUNT"), prevPresentRef.current = present;
|
| 1511 |
+
}
|
| 1512 |
+
}, [
|
| 1513 |
+
present,
|
| 1514 |
+
send
|
| 1515 |
+
]), $9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
| 1516 |
+
if (node1) {
|
| 1517 |
+
let handleAnimationEnd = (event) => {
|
| 1518 |
+
let isCurrentAnimation = $921a889cee6df7e8$var$getAnimationName(stylesRef.current).includes(event.animationName);
|
| 1519 |
+
event.target === node1 && isCurrentAnimation && $iqq3r$flushSync(
|
| 1520 |
+
() => send("ANIMATION_END")
|
| 1521 |
+
);
|
| 1522 |
+
}, handleAnimationStart = (event) => {
|
| 1523 |
+
event.target === node1 && (prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current));
|
| 1524 |
+
};
|
| 1525 |
+
return node1.addEventListener("animationstart", handleAnimationStart), node1.addEventListener("animationcancel", handleAnimationEnd), node1.addEventListener("animationend", handleAnimationEnd), () => {
|
| 1526 |
+
node1.removeEventListener("animationstart", handleAnimationStart), node1.removeEventListener("animationcancel", handleAnimationEnd), node1.removeEventListener("animationend", handleAnimationEnd);
|
| 1527 |
+
};
|
| 1528 |
+
} else
|
| 1529 |
+
send("ANIMATION_END");
|
| 1530 |
+
}, [
|
| 1531 |
+
node1,
|
| 1532 |
+
send
|
| 1533 |
+
]), {
|
| 1534 |
+
isPresent: [
|
| 1535 |
+
"mounted",
|
| 1536 |
+
"unmountSuspended"
|
| 1537 |
+
].includes(state),
|
| 1538 |
+
ref: $iqq3r$useCallback((node) => {
|
| 1539 |
+
node && (stylesRef.current = getComputedStyle(node)), setNode(node);
|
| 1540 |
+
}, [])
|
| 1541 |
+
};
|
| 1542 |
+
}
|
| 1543 |
+
function $921a889cee6df7e8$var$getAnimationName(styles) {
|
| 1544 |
+
return styles?.animationName || "none";
|
| 1545 |
+
}
|
| 1546 |
+
|
| 1547 |
+
// ../../../node_modules/@radix-ui/react-tabs/dist/index.mjs
|
| 1548 |
+
var $69cb30bb0017df05$var$TABS_NAME = "Tabs", [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($69cb30bb0017df05$var$TABS_NAME, [
|
| 1549 |
+
$d7bdfb9eb0fdf311$export$c7109489551a4f4
|
| 1550 |
+
]), $69cb30bb0017df05$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4(), [$69cb30bb0017df05$var$TabsProvider, $69cb30bb0017df05$var$useTabsContext] = $69cb30bb0017df05$var$createTabsContext($69cb30bb0017df05$var$TABS_NAME), $69cb30bb0017df05$export$b2539bed5023c21c = $1IHzk$forwardRef((props, forwardedRef) => {
|
| 1551 |
+
let { __scopeTabs, value: valueProp, onValueChange, defaultValue, orientation = "horizontal", dir, activationMode = "automatic", ...tabsProps } = props, direction = $f631663db3294ace$export$b39126d51d94e6f3(dir), [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
| 1552 |
+
prop: valueProp,
|
| 1553 |
+
onChange: onValueChange,
|
| 1554 |
+
defaultProp: defaultValue
|
| 1555 |
+
});
|
| 1556 |
+
return $1IHzk$createElement($69cb30bb0017df05$var$TabsProvider, {
|
| 1557 |
+
scope: __scopeTabs,
|
| 1558 |
+
baseId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
| 1559 |
+
value,
|
| 1560 |
+
onValueChange: setValue,
|
| 1561 |
+
orientation,
|
| 1562 |
+
dir: direction,
|
| 1563 |
+
activationMode
|
| 1564 |
+
}, $1IHzk$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
| 1565 |
+
dir: direction,
|
| 1566 |
+
"data-orientation": orientation
|
| 1567 |
+
}, tabsProps, {
|
| 1568 |
+
ref: forwardedRef
|
| 1569 |
+
})));
|
| 1570 |
+
});
|
| 1571 |
+
Object.assign($69cb30bb0017df05$export$b2539bed5023c21c, {
|
| 1572 |
+
displayName: $69cb30bb0017df05$var$TABS_NAME
|
| 1573 |
+
});
|
| 1574 |
+
var $69cb30bb0017df05$var$TAB_LIST_NAME = "TabsList", $69cb30bb0017df05$export$9712d22edc0d78c1 = $1IHzk$forwardRef((props, forwardedRef) => {
|
| 1575 |
+
let { __scopeTabs, loop = !0, ...listProps } = props, context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME, __scopeTabs), rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
|
| 1576 |
+
return $1IHzk$createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends({
|
| 1577 |
+
asChild: !0
|
| 1578 |
+
}, rovingFocusGroupScope, {
|
| 1579 |
+
orientation: context.orientation,
|
| 1580 |
+
dir: context.dir,
|
| 1581 |
+
loop
|
| 1582 |
+
}), $1IHzk$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
| 1583 |
+
role: "tablist",
|
| 1584 |
+
"aria-orientation": context.orientation
|
| 1585 |
+
}, listProps, {
|
| 1586 |
+
ref: forwardedRef
|
| 1587 |
+
})));
|
| 1588 |
+
});
|
| 1589 |
+
Object.assign($69cb30bb0017df05$export$9712d22edc0d78c1, {
|
| 1590 |
+
displayName: $69cb30bb0017df05$var$TAB_LIST_NAME
|
| 1591 |
+
});
|
| 1592 |
+
var $69cb30bb0017df05$var$TRIGGER_NAME = "TabsTrigger", $69cb30bb0017df05$export$8114b9fdfdf9f3ba = $1IHzk$forwardRef((props, forwardedRef) => {
|
| 1593 |
+
let { __scopeTabs, value, disabled = !1, ...triggerProps } = props, context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TRIGGER_NAME, __scopeTabs), rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs), triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value), contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value), isSelected = value === context.value;
|
| 1594 |
+
return $1IHzk$createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends({
|
| 1595 |
+
asChild: !0
|
| 1596 |
+
}, rovingFocusGroupScope, {
|
| 1597 |
+
focusable: !disabled,
|
| 1598 |
+
active: isSelected
|
| 1599 |
+
}), $1IHzk$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
| 1600 |
+
type: "button",
|
| 1601 |
+
role: "tab",
|
| 1602 |
+
"aria-selected": isSelected,
|
| 1603 |
+
"aria-controls": contentId,
|
| 1604 |
+
"data-state": isSelected ? "active" : "inactive",
|
| 1605 |
+
"data-disabled": disabled ? "" : void 0,
|
| 1606 |
+
disabled,
|
| 1607 |
+
id: triggerId
|
| 1608 |
+
}, triggerProps, {
|
| 1609 |
+
ref: forwardedRef,
|
| 1610 |
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event) => {
|
| 1611 |
+
!disabled && event.button === 0 && event.ctrlKey === !1 ? context.onValueChange(value) : event.preventDefault();
|
| 1612 |
+
}),
|
| 1613 |
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event) => {
|
| 1614 |
+
[
|
| 1615 |
+
" ",
|
| 1616 |
+
"Enter"
|
| 1617 |
+
].includes(event.key) && context.onValueChange(value);
|
| 1618 |
+
}),
|
| 1619 |
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, () => {
|
| 1620 |
+
let isAutomaticActivation = context.activationMode !== "manual";
|
| 1621 |
+
!isSelected && !disabled && isAutomaticActivation && context.onValueChange(value);
|
| 1622 |
+
})
|
| 1623 |
+
})));
|
| 1624 |
+
});
|
| 1625 |
+
Object.assign($69cb30bb0017df05$export$8114b9fdfdf9f3ba, {
|
| 1626 |
+
displayName: $69cb30bb0017df05$var$TRIGGER_NAME
|
| 1627 |
+
});
|
| 1628 |
+
var $69cb30bb0017df05$var$CONTENT_NAME = "TabsContent", $69cb30bb0017df05$export$bd905d70e8fd2ebb = $1IHzk$forwardRef((props, forwardedRef) => {
|
| 1629 |
+
let { __scopeTabs, value, forceMount, children, ...contentProps } = props, context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$CONTENT_NAME, __scopeTabs), triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value), contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value), isSelected = value === context.value, isMountAnimationPreventedRef = $1IHzk$useRef(isSelected);
|
| 1630 |
+
return $1IHzk$useEffect(() => {
|
| 1631 |
+
let rAF = requestAnimationFrame(
|
| 1632 |
+
() => isMountAnimationPreventedRef.current = !1
|
| 1633 |
+
);
|
| 1634 |
+
return () => cancelAnimationFrame(rAF);
|
| 1635 |
+
}, []), $1IHzk$createElement(
|
| 1636 |
+
$921a889cee6df7e8$export$99c2b779aa4e8b8b,
|
| 1637 |
+
{
|
| 1638 |
+
present: forceMount || isSelected
|
| 1639 |
+
},
|
| 1640 |
+
({ present }) => $1IHzk$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
| 1641 |
+
"data-state": isSelected ? "active" : "inactive",
|
| 1642 |
+
"data-orientation": context.orientation,
|
| 1643 |
+
role: "tabpanel",
|
| 1644 |
+
"aria-labelledby": triggerId,
|
| 1645 |
+
hidden: !present,
|
| 1646 |
+
id: contentId,
|
| 1647 |
+
tabIndex: 0
|
| 1648 |
+
}, contentProps, {
|
| 1649 |
+
ref: forwardedRef,
|
| 1650 |
+
style: {
|
| 1651 |
+
...props.style,
|
| 1652 |
+
animationDuration: isMountAnimationPreventedRef.current ? "0s" : void 0
|
| 1653 |
+
}
|
| 1654 |
+
}), present && children)
|
| 1655 |
+
);
|
| 1656 |
+
});
|
| 1657 |
+
Object.assign($69cb30bb0017df05$export$bd905d70e8fd2ebb, {
|
| 1658 |
+
displayName: $69cb30bb0017df05$var$CONTENT_NAME
|
| 1659 |
+
});
|
| 1660 |
+
function $69cb30bb0017df05$var$makeTriggerId(baseId, value) {
|
| 1661 |
+
return `${baseId}-trigger-${value}`;
|
| 1662 |
+
}
|
| 1663 |
+
function $69cb30bb0017df05$var$makeContentId(baseId, value) {
|
| 1664 |
+
return `${baseId}-content-${value}`;
|
| 1665 |
+
}
|
| 1666 |
+
var $69cb30bb0017df05$export$be92b6f5f03c0fe9 = $69cb30bb0017df05$export$b2539bed5023c21c, $69cb30bb0017df05$export$54c2e3dc7acea9f5 = $69cb30bb0017df05$export$9712d22edc0d78c1, $69cb30bb0017df05$export$41fb9f06171c75f4 = $69cb30bb0017df05$export$8114b9fdfdf9f3ba, $69cb30bb0017df05$export$7c6e2c02157bb7d2 = $69cb30bb0017df05$export$bd905d70e8fd2ebb;
|
| 1667 |
+
|
| 1668 |
+
// src/components/Report/Details.tsx
|
| 1669 |
+
import { styled } from "storybook/theming";
|
| 1670 |
+
var StyledSyntaxHighlighter = styled(SyntaxHighlighter)(
|
| 1671 |
+
({ theme: theme2 }) => ({
|
| 1672 |
+
fontSize: theme2.typography.size.s1
|
| 1673 |
+
}),
|
| 1674 |
+
({ language }) => (
|
| 1675 |
+
// We appended ' {}' to the selector in order to get proper syntax highlighting. This rule hides the last 3 spans
|
| 1676 |
+
// (one character each) in the displayed output. Only siblings of .selector (the actual CSS selector characters)
|
| 1677 |
+
// are targeted so that the code comment line isn't affected.
|
| 1678 |
+
language === "css" && {
|
| 1679 |
+
".selector ~ span:nth-last-of-type(-n+3)": {
|
| 1680 |
+
display: "none"
|
| 1681 |
+
}
|
| 1682 |
+
}
|
| 1683 |
+
)
|
| 1684 |
+
), Info = styled.div({
|
| 1685 |
+
display: "flex",
|
| 1686 |
+
flexDirection: "column"
|
| 1687 |
+
}), RuleId = styled.div(({ theme: theme2 }) => ({
|
| 1688 |
+
display: "block",
|
| 1689 |
+
color: theme2.textMutedColor,
|
| 1690 |
+
fontFamily: theme2.typography.fonts.mono,
|
| 1691 |
+
fontSize: theme2.typography.size.s1,
|
| 1692 |
+
marginTop: -8,
|
| 1693 |
+
marginBottom: 12,
|
| 1694 |
+
"@container (min-width: 800px)": {
|
| 1695 |
+
display: "none"
|
| 1696 |
+
}
|
| 1697 |
+
})), Description = styled.p({
|
| 1698 |
+
margin: 0
|
| 1699 |
+
}), Wrapper = styled.div({
|
| 1700 |
+
display: "flex",
|
| 1701 |
+
flexDirection: "column",
|
| 1702 |
+
padding: "0 15px 20px 15px",
|
| 1703 |
+
gap: 20
|
| 1704 |
+
}), Columns = styled.div({
|
| 1705 |
+
gap: 15,
|
| 1706 |
+
"@container (min-width: 800px)": {
|
| 1707 |
+
display: "grid",
|
| 1708 |
+
gridTemplateColumns: "50% 50%"
|
| 1709 |
+
}
|
| 1710 |
+
}), Content = styled.div(({ theme: theme2, side }) => ({
|
| 1711 |
+
display: side === "left" ? "flex" : "none",
|
| 1712 |
+
flexDirection: "column",
|
| 1713 |
+
gap: 15,
|
| 1714 |
+
margin: side === "left" ? "15px 0" : 0,
|
| 1715 |
+
padding: side === "left" ? "0 15px" : 0,
|
| 1716 |
+
borderLeft: side === "left" ? `1px solid ${theme2.color.border}` : "none",
|
| 1717 |
+
"&:focus-visible": {
|
| 1718 |
+
outline: "none",
|
| 1719 |
+
borderRadius: 4,
|
| 1720 |
+
boxShadow: `0 0 0 1px inset ${theme2.color.secondary}`
|
| 1721 |
+
},
|
| 1722 |
+
"@container (min-width: 800px)": {
|
| 1723 |
+
display: side === "left" ? "none" : "flex"
|
| 1724 |
+
}
|
| 1725 |
+
})), Item = styled(Button)(({ theme: theme2 }) => ({
|
| 1726 |
+
fontFamily: theme2.typography.fonts.mono,
|
| 1727 |
+
fontWeight: theme2.typography.weight.regular,
|
| 1728 |
+
color: theme2.textMutedColor,
|
| 1729 |
+
height: 40,
|
| 1730 |
+
overflow: "hidden",
|
| 1731 |
+
textOverflow: "ellipsis",
|
| 1732 |
+
whiteSpace: "nowrap",
|
| 1733 |
+
display: "block",
|
| 1734 |
+
width: "100%",
|
| 1735 |
+
textAlign: "left",
|
| 1736 |
+
padding: "0 12px",
|
| 1737 |
+
'&[data-state="active"]': {
|
| 1738 |
+
color: theme2.color.secondary,
|
| 1739 |
+
backgroundColor: theme2.background.hoverable
|
| 1740 |
+
}
|
| 1741 |
+
})), Messages = styled.div({
|
| 1742 |
+
display: "flex",
|
| 1743 |
+
flexDirection: "column",
|
| 1744 |
+
gap: 10
|
| 1745 |
+
}), Actions = styled.div({
|
| 1746 |
+
display: "flex",
|
| 1747 |
+
gap: 10
|
| 1748 |
+
}), CopyButton = ({ onClick }) => {
|
| 1749 |
+
let [copied, setCopied] = useState3(!1), handleClick = useCallback2(() => {
|
| 1750 |
+
onClick(), setCopied(!0);
|
| 1751 |
+
let timeout = setTimeout(() => setCopied(!1), 2e3);
|
| 1752 |
+
return () => clearTimeout(timeout);
|
| 1753 |
+
}, [onClick]);
|
| 1754 |
+
return React2.createElement(Button, { ariaLabel: !1, onClick: handleClick }, copied ? React2.createElement(CheckIcon, null) : React2.createElement(CopyIcon, null), " ", copied ? "Copied" : "Copy link");
|
| 1755 |
+
}, Details = ({ id, item, type, selection, handleSelectionChange }) => React2.createElement(Wrapper, { id }, React2.createElement(Info, null, React2.createElement(RuleId, null, item.id), React2.createElement(Description, null, getFriendlySummaryForAxeResult(item), " ", React2.createElement(Link, { href: item.helpUrl, target: "_blank", rel: "noopener noreferrer", withArrow: !0 }, "Learn how to resolve this violation"))), React2.createElement(
|
| 1756 |
+
$69cb30bb0017df05$export$be92b6f5f03c0fe9,
|
| 1757 |
+
{
|
| 1758 |
+
defaultValue: selection,
|
| 1759 |
+
orientation: "vertical",
|
| 1760 |
+
value: selection,
|
| 1761 |
+
onValueChange: handleSelectionChange,
|
| 1762 |
+
asChild: !0
|
| 1763 |
+
},
|
| 1764 |
+
React2.createElement(Columns, null, React2.createElement($69cb30bb0017df05$export$54c2e3dc7acea9f5, { "aria-label": type }, item.nodes.map((node, index) => {
|
| 1765 |
+
let key = `${type}.${item.id}.${index + 1}`;
|
| 1766 |
+
return React2.createElement(Fragment, { key }, React2.createElement($69cb30bb0017df05$export$41fb9f06171c75f4, { value: key, asChild: !0 }, React2.createElement(Item, { ariaLabel: !1, variant: "ghost", size: "medium", id: key }, index + 1, ". ", node.html)), React2.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { value: key, asChild: !0 }, React2.createElement(Content, { side: "left" }, getContent(node))));
|
| 1767 |
+
})), item.nodes.map((node, index) => {
|
| 1768 |
+
let key = `${type}.${item.id}.${index + 1}`;
|
| 1769 |
+
return React2.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { key, value: key, asChild: !0 }, React2.createElement(Content, { side: "right" }, getContent(node)));
|
| 1770 |
+
}))
|
| 1771 |
+
));
|
| 1772 |
+
function getContent(node) {
|
| 1773 |
+
let { handleCopyLink, handleJumpToElement } = useA11yContext(), { any, all, none, html, target } = node, rules = [...any, ...all, ...none];
|
| 1774 |
+
return React2.createElement(React2.Fragment, null, React2.createElement(Messages, null, rules.map((rule) => React2.createElement("div", { key: rule.id }, `${rule.message}${/(\.|: [^.]+\.*)$/.test(rule.message) ? "" : "."}`))), React2.createElement(Actions, null, React2.createElement(Button, { ariaLabel: !1, onClick: () => handleJumpToElement(node.target.toString()) }, React2.createElement(LocationIcon, null), " Jump to element"), React2.createElement(CopyButton, { onClick: () => handleCopyLink(node.linkPath) })), React2.createElement(
|
| 1775 |
+
StyledSyntaxHighlighter,
|
| 1776 |
+
{
|
| 1777 |
+
language: "jsx",
|
| 1778 |
+
wrapLongLines: !0
|
| 1779 |
+
},
|
| 1780 |
+
`/* element */
|
| 1781 |
+
${html}`
|
| 1782 |
+
), React2.createElement(
|
| 1783 |
+
StyledSyntaxHighlighter,
|
| 1784 |
+
{
|
| 1785 |
+
language: "css",
|
| 1786 |
+
wrapLongLines: !0
|
| 1787 |
+
},
|
| 1788 |
+
`/* selector */
|
| 1789 |
+
${target} {}`
|
| 1790 |
+
));
|
| 1791 |
+
}
|
| 1792 |
+
|
| 1793 |
+
// src/components/Report/Report.tsx
|
| 1794 |
+
var impactStatus = {
|
| 1795 |
+
minor: "neutral",
|
| 1796 |
+
moderate: "warning",
|
| 1797 |
+
serious: "negative",
|
| 1798 |
+
critical: "critical"
|
| 1799 |
+
}, impactLabels = {
|
| 1800 |
+
minor: "Minor",
|
| 1801 |
+
moderate: "Moderate",
|
| 1802 |
+
serious: "Serious",
|
| 1803 |
+
critical: "Critical"
|
| 1804 |
+
}, Wrapper2 = styled2.div(({ theme: theme2 }) => ({
|
| 1805 |
+
display: "flex",
|
| 1806 |
+
flexDirection: "column",
|
| 1807 |
+
width: "100%",
|
| 1808 |
+
borderBottom: `1px solid ${theme2.appBorderColor}`,
|
| 1809 |
+
containerType: "inline-size",
|
| 1810 |
+
fontSize: theme2.typography.size.s2
|
| 1811 |
+
})), Icon = styled2(ChevronSmallDownIcon)({
|
| 1812 |
+
transition: "transform 0.1s ease-in-out"
|
| 1813 |
+
}), HeaderBar = styled2.div(({ theme: theme2 }) => ({
|
| 1814 |
+
display: "flex",
|
| 1815 |
+
justifyContent: "space-between",
|
| 1816 |
+
alignItems: "center",
|
| 1817 |
+
gap: 6,
|
| 1818 |
+
padding: "6px 10px 6px 15px",
|
| 1819 |
+
minHeight: 40,
|
| 1820 |
+
background: "none",
|
| 1821 |
+
color: "inherit",
|
| 1822 |
+
textAlign: "left",
|
| 1823 |
+
cursor: "pointer",
|
| 1824 |
+
width: "100%",
|
| 1825 |
+
"&:hover": {
|
| 1826 |
+
color: theme2.color.secondary
|
| 1827 |
+
}
|
| 1828 |
+
})), Title = styled2.div(({ theme: theme2 }) => ({
|
| 1829 |
+
display: "flex",
|
| 1830 |
+
alignItems: "baseline",
|
| 1831 |
+
flexGrow: 1,
|
| 1832 |
+
fontSize: theme2.typography.size.s2,
|
| 1833 |
+
gap: 8
|
| 1834 |
+
})), RuleId2 = styled2.div(({ theme: theme2 }) => ({
|
| 1835 |
+
display: "none",
|
| 1836 |
+
color: theme2.textMutedColor,
|
| 1837 |
+
fontFamily: theme2.typography.fonts.mono,
|
| 1838 |
+
fontSize: theme2.typography.size.s1,
|
| 1839 |
+
"@container (min-width: 800px)": {
|
| 1840 |
+
display: "block"
|
| 1841 |
+
}
|
| 1842 |
+
})), Count = styled2.div(({ theme: theme2 }) => ({
|
| 1843 |
+
display: "flex",
|
| 1844 |
+
alignItems: "center",
|
| 1845 |
+
justifyContent: "center",
|
| 1846 |
+
color: theme2.textMutedColor,
|
| 1847 |
+
width: 28,
|
| 1848 |
+
height: 28
|
| 1849 |
+
})), Report = ({
|
| 1850 |
+
items,
|
| 1851 |
+
empty,
|
| 1852 |
+
type,
|
| 1853 |
+
handleSelectionChange,
|
| 1854 |
+
selectedItems,
|
| 1855 |
+
toggleOpen
|
| 1856 |
+
}) => React3.createElement(React3.Fragment, null, items && items.length ? items.map((item) => {
|
| 1857 |
+
let id = `${type}.${item.id}`, detailsId = `details:${id}`, selection = selectedItems.get(id), title = getTitleForAxeResult(item);
|
| 1858 |
+
return React3.createElement(Wrapper2, { key: id }, React3.createElement(HeaderBar, { onClick: (event) => toggleOpen(event, type, item), "data-active": !!selection }, React3.createElement(Title, null, React3.createElement("strong", null, title), React3.createElement(RuleId2, null, item.id)), item.impact && React3.createElement(Badge, { status: type === RuleType.PASS ? "neutral" : impactStatus[item.impact] }, impactLabels[item.impact]), React3.createElement(Count, null, item.nodes.length), React3.createElement(
|
| 1859 |
+
Button2,
|
| 1860 |
+
{
|
| 1861 |
+
onClick: (event) => toggleOpen(event, type, item),
|
| 1862 |
+
ariaLabel: `${selection ? "Collapse" : "Expand"} details for: ${title}`,
|
| 1863 |
+
"aria-expanded": !!selection,
|
| 1864 |
+
"aria-controls": detailsId,
|
| 1865 |
+
variant: "ghost",
|
| 1866 |
+
padding: "small"
|
| 1867 |
+
},
|
| 1868 |
+
React3.createElement(Icon, { style: { transform: `rotate(${selection ? -180 : 0}deg)` } })
|
| 1869 |
+
)), selection ? React3.createElement(
|
| 1870 |
+
Details,
|
| 1871 |
+
{
|
| 1872 |
+
id: detailsId,
|
| 1873 |
+
item,
|
| 1874 |
+
type,
|
| 1875 |
+
selection,
|
| 1876 |
+
handleSelectionChange
|
| 1877 |
+
}
|
| 1878 |
+
) : React3.createElement("div", { id: detailsId }));
|
| 1879 |
+
}) : React3.createElement(EmptyTabContent, { title: empty }));
|
| 1880 |
+
|
| 1881 |
+
// src/components/Tabs.tsx
|
| 1882 |
+
import * as React4 from "react";
|
| 1883 |
+
import { Button as Button3, TabsView } from "storybook/internal/components";
|
| 1884 |
+
import { CollapseIcon, ExpandAltIcon, EyeCloseIcon, EyeIcon, SyncIcon } from "@storybook/icons";
|
| 1885 |
+
import { styled as styled3, useTheme } from "storybook/theming";
|
| 1886 |
+
var Container = styled3.div({
|
| 1887 |
+
width: "100%",
|
| 1888 |
+
position: "relative",
|
| 1889 |
+
height: "100%",
|
| 1890 |
+
overflow: "hidden",
|
| 1891 |
+
display: "flex",
|
| 1892 |
+
flexDirection: "column"
|
| 1893 |
+
}), ActionsWrapper = styled3.div({
|
| 1894 |
+
display: "flex",
|
| 1895 |
+
justifyContent: "flex-end",
|
| 1896 |
+
gap: 6
|
| 1897 |
+
}), Tabs = ({ tabs }) => {
|
| 1898 |
+
let {
|
| 1899 |
+
tab,
|
| 1900 |
+
setTab,
|
| 1901 |
+
toggleHighlight,
|
| 1902 |
+
highlighted,
|
| 1903 |
+
handleManual,
|
| 1904 |
+
allExpanded,
|
| 1905 |
+
handleCollapseAll,
|
| 1906 |
+
handleExpandAll
|
| 1907 |
+
} = useA11yContext(), theme2 = useTheme();
|
| 1908 |
+
return React4.createElement(Container, null, React4.createElement(
|
| 1909 |
+
TabsView,
|
| 1910 |
+
{
|
| 1911 |
+
backgroundColor: theme2.background.app,
|
| 1912 |
+
panelProps: { hasScrollbar: !0 },
|
| 1913 |
+
tabs: tabs.map((tab2) => ({
|
| 1914 |
+
id: tab2.type,
|
| 1915 |
+
title: tab2.label,
|
| 1916 |
+
children: tab2.panel
|
| 1917 |
+
})),
|
| 1918 |
+
selected: tab,
|
| 1919 |
+
onSelectionChange: (key) => setTab(key),
|
| 1920 |
+
tools: React4.createElement(ActionsWrapper, null, React4.createElement(
|
| 1921 |
+
Button3,
|
| 1922 |
+
{
|
| 1923 |
+
variant: "ghost",
|
| 1924 |
+
padding: "small",
|
| 1925 |
+
onClick: toggleHighlight,
|
| 1926 |
+
ariaLabel: highlighted ? "Hide accessibility test result highlights" : "Highlight elements with accessibility test results"
|
| 1927 |
+
},
|
| 1928 |
+
highlighted ? React4.createElement(EyeCloseIcon, null) : React4.createElement(EyeIcon, null)
|
| 1929 |
+
), React4.createElement(
|
| 1930 |
+
Button3,
|
| 1931 |
+
{
|
| 1932 |
+
variant: "ghost",
|
| 1933 |
+
padding: "small",
|
| 1934 |
+
onClick: allExpanded ? handleCollapseAll : handleExpandAll,
|
| 1935 |
+
ariaLabel: allExpanded ? "Collapse all results" : "Expand all results",
|
| 1936 |
+
"aria-expanded": allExpanded
|
| 1937 |
+
},
|
| 1938 |
+
allExpanded ? React4.createElement(CollapseIcon, null) : React4.createElement(ExpandAltIcon, null)
|
| 1939 |
+
), React4.createElement(
|
| 1940 |
+
Button3,
|
| 1941 |
+
{
|
| 1942 |
+
variant: "ghost",
|
| 1943 |
+
padding: "small",
|
| 1944 |
+
onClick: handleManual,
|
| 1945 |
+
ariaLabel: "Rerun accessibility scan"
|
| 1946 |
+
},
|
| 1947 |
+
React4.createElement(SyncIcon, null)
|
| 1948 |
+
))
|
| 1949 |
+
}
|
| 1950 |
+
));
|
| 1951 |
+
};
|
| 1952 |
+
|
| 1953 |
+
// src/components/TestDiscrepancyMessage.tsx
|
| 1954 |
+
import React5, { useMemo as useMemo2 } from "react";
|
| 1955 |
+
import { Link as Link2 } from "storybook/internal/components";
|
| 1956 |
+
import { useStorybookApi as useStorybookApi2 } from "storybook/manager-api";
|
| 1957 |
+
import { styled as styled4 } from "storybook/theming";
|
| 1958 |
+
var Wrapper3 = styled4.div(({ theme: { color, typography, background } }) => ({
|
| 1959 |
+
textAlign: "start",
|
| 1960 |
+
padding: "11px 15px",
|
| 1961 |
+
fontSize: `${typography.size.s2}px`,
|
| 1962 |
+
fontWeight: typography.weight.regular,
|
| 1963 |
+
lineHeight: "1rem",
|
| 1964 |
+
background: background.app,
|
| 1965 |
+
borderBottom: `1px solid ${color.border}`,
|
| 1966 |
+
color: color.defaultText,
|
| 1967 |
+
backgroundClip: "padding-box",
|
| 1968 |
+
position: "relative",
|
| 1969 |
+
code: {
|
| 1970 |
+
fontSize: `${typography.size.s1 - 1}px`,
|
| 1971 |
+
color: "inherit",
|
| 1972 |
+
margin: "0 0.2em",
|
| 1973 |
+
padding: "0 0.2em",
|
| 1974 |
+
background: "rgba(255, 255, 255, 0.8)",
|
| 1975 |
+
borderRadius: "2px",
|
| 1976 |
+
boxShadow: "0 0 0 1px rgba(0, 0, 0, 0.1)"
|
| 1977 |
+
}
|
| 1978 |
+
})), TestDiscrepancyMessage = ({ discrepancy }) => {
|
| 1979 |
+
let docsUrl = useStorybookApi2().getDocsUrl({
|
| 1980 |
+
subpath: DOCUMENTATION_DISCREPANCY_LINK,
|
| 1981 |
+
versioned: !0,
|
| 1982 |
+
renderer: !0
|
| 1983 |
+
}), message = useMemo2(() => {
|
| 1984 |
+
switch (discrepancy) {
|
| 1985 |
+
case "browserPassedCliFailed":
|
| 1986 |
+
return "Accessibility checks passed in this browser but failed in the CLI.";
|
| 1987 |
+
case "cliPassedBrowserFailed":
|
| 1988 |
+
return "Accessibility checks passed in the CLI but failed in this browser.";
|
| 1989 |
+
case "cliFailedButModeManual":
|
| 1990 |
+
return "Accessibility checks failed in the CLI. Run the tests manually to see the results.";
|
| 1991 |
+
default:
|
| 1992 |
+
return null;
|
| 1993 |
+
}
|
| 1994 |
+
}, [discrepancy]);
|
| 1995 |
+
return message ? React5.createElement(Wrapper3, null, message, " ", React5.createElement(Link2, { href: docsUrl, target: "_blank", withArrow: !0 }, "Learn what could cause this")) : null;
|
| 1996 |
+
};
|
| 1997 |
+
|
| 1998 |
+
// src/components/A11YPanel.tsx
|
| 1999 |
+
var RotatingIcon = styled5(SyncIcon2)(({ theme: theme2 }) => ({
|
| 2000 |
+
animation: `${theme2.animation.rotate360} 1s linear infinite;`,
|
| 2001 |
+
margin: 4
|
| 2002 |
+
})), Tab = styled5.div({
|
| 2003 |
+
display: "flex",
|
| 2004 |
+
alignItems: "center",
|
| 2005 |
+
gap: 6
|
| 2006 |
+
}), Centered = styled5.span(({ theme: theme2 }) => ({
|
| 2007 |
+
display: "flex",
|
| 2008 |
+
flexDirection: "column",
|
| 2009 |
+
alignItems: "center",
|
| 2010 |
+
justifyContent: "center",
|
| 2011 |
+
textAlign: "center",
|
| 2012 |
+
fontSize: theme2.typography.size.s2,
|
| 2013 |
+
height: "100%",
|
| 2014 |
+
gap: 24,
|
| 2015 |
+
div: {
|
| 2016 |
+
display: "flex",
|
| 2017 |
+
flexDirection: "column",
|
| 2018 |
+
alignItems: "center",
|
| 2019 |
+
gap: 8
|
| 2020 |
+
},
|
| 2021 |
+
p: {
|
| 2022 |
+
margin: 0,
|
| 2023 |
+
color: theme2.textMutedColor
|
| 2024 |
+
},
|
| 2025 |
+
code: {
|
| 2026 |
+
display: "inline-block",
|
| 2027 |
+
fontSize: theme2.typography.size.s2 - 1,
|
| 2028 |
+
backgroundColor: theme2.background.app,
|
| 2029 |
+
border: `1px solid ${theme2.color.border}`,
|
| 2030 |
+
borderRadius: 4,
|
| 2031 |
+
padding: "2px 3px"
|
| 2032 |
+
}
|
| 2033 |
+
})), A11YPanel = () => {
|
| 2034 |
+
let {
|
| 2035 |
+
parameters,
|
| 2036 |
+
tab,
|
| 2037 |
+
results,
|
| 2038 |
+
status,
|
| 2039 |
+
handleManual,
|
| 2040 |
+
error,
|
| 2041 |
+
discrepancy,
|
| 2042 |
+
handleSelectionChange,
|
| 2043 |
+
selectedItems,
|
| 2044 |
+
toggleOpen
|
| 2045 |
+
} = useA11yContext(), tabs = useMemo3(() => {
|
| 2046 |
+
let { passes, incomplete, violations } = results ?? {
|
| 2047 |
+
passes: [],
|
| 2048 |
+
incomplete: [],
|
| 2049 |
+
violations: []
|
| 2050 |
+
};
|
| 2051 |
+
return [
|
| 2052 |
+
{
|
| 2053 |
+
label: React6.createElement(Tab, null, "Violations", React6.createElement(Badge2, { compact: !0, status: tab === "violations" ? "active" : "neutral" }, violations.length)),
|
| 2054 |
+
panel: React6.createElement(
|
| 2055 |
+
Report,
|
| 2056 |
+
{
|
| 2057 |
+
items: violations,
|
| 2058 |
+
type: RuleType.VIOLATION,
|
| 2059 |
+
empty: "No accessibility violations found.",
|
| 2060 |
+
handleSelectionChange,
|
| 2061 |
+
selectedItems,
|
| 2062 |
+
toggleOpen
|
| 2063 |
+
}
|
| 2064 |
+
),
|
| 2065 |
+
items: violations,
|
| 2066 |
+
type: RuleType.VIOLATION
|
| 2067 |
+
},
|
| 2068 |
+
{
|
| 2069 |
+
label: React6.createElement(Tab, null, "Passes", React6.createElement(Badge2, { compact: !0, status: tab === "passes" ? "active" : "neutral" }, passes.length)),
|
| 2070 |
+
panel: React6.createElement(
|
| 2071 |
+
Report,
|
| 2072 |
+
{
|
| 2073 |
+
items: passes,
|
| 2074 |
+
type: RuleType.PASS,
|
| 2075 |
+
empty: "No passing accessibility checks found.",
|
| 2076 |
+
handleSelectionChange,
|
| 2077 |
+
selectedItems,
|
| 2078 |
+
toggleOpen
|
| 2079 |
+
}
|
| 2080 |
+
),
|
| 2081 |
+
items: passes,
|
| 2082 |
+
type: RuleType.PASS
|
| 2083 |
+
},
|
| 2084 |
+
{
|
| 2085 |
+
label: React6.createElement(Tab, null, "Inconclusive", React6.createElement(Badge2, { compact: !0, status: tab === "incomplete" ? "active" : "neutral" }, incomplete.length)),
|
| 2086 |
+
panel: React6.createElement(
|
| 2087 |
+
Report,
|
| 2088 |
+
{
|
| 2089 |
+
items: incomplete,
|
| 2090 |
+
type: RuleType.INCOMPLETION,
|
| 2091 |
+
empty: "No inconclusive accessibility checks found.",
|
| 2092 |
+
handleSelectionChange,
|
| 2093 |
+
selectedItems,
|
| 2094 |
+
toggleOpen
|
| 2095 |
+
}
|
| 2096 |
+
),
|
| 2097 |
+
items: incomplete,
|
| 2098 |
+
type: RuleType.INCOMPLETION
|
| 2099 |
+
}
|
| 2100 |
+
];
|
| 2101 |
+
}, [tab, results, handleSelectionChange, selectedItems, toggleOpen]);
|
| 2102 |
+
return parameters.disable || parameters.test === "off" ? React6.createElement(Centered, null, React6.createElement("div", null, React6.createElement("strong", null, "Accessibility tests are disabled for this story"), React6.createElement("p", null, "Update", " ", React6.createElement("code", null, parameters.disable ? "parameters.a11y.disable" : "parameters.a11y.test"), " ", "to enable accessibility tests."))) : React6.createElement(React6.Fragment, null, discrepancy && React6.createElement(TestDiscrepancyMessage, { discrepancy }), status === "ready" || status === "ran" ? React6.createElement(Tabs, { key: "tabs", tabs }) : React6.createElement(Centered, { style: { marginTop: discrepancy ? "1em" : 0 } }, status === "initial" && React6.createElement("div", null, React6.createElement(RotatingIcon, { size: 12 }), React6.createElement("strong", null, "Preparing accessibility scan"), React6.createElement("p", null, "Please wait while the addon is initializing...")), status === "manual" && React6.createElement(React6.Fragment, null, React6.createElement("div", null, React6.createElement("strong", null, "Accessibility tests run manually for this story"), React6.createElement("p", null, "Results will not show when using the testing module. You can still run accessibility tests manually.")), React6.createElement(Button4, { ariaLabel: !1, size: "medium", onClick: handleManual }, "Run accessibility scan"), React6.createElement("p", null, "Update ", React6.createElement("code", null, "globals.a11y.manual"), " to disable manual mode.")), status === "running" && React6.createElement("div", null, React6.createElement(RotatingIcon, { size: 12 }), React6.createElement("strong", null, "Accessibility scan in progress"), React6.createElement("p", null, "Please wait while the accessibility scan is running...")), status === "error" && React6.createElement(React6.Fragment, null, React6.createElement("div", null, React6.createElement("strong", null, "The accessibility scan encountered an error"), React6.createElement("p", null, typeof error == "string" ? error : error instanceof Error ? error.toString() : JSON.stringify(error, null, 2))), React6.createElement(Button4, { ariaLabel: !1, size: "medium", onClick: handleManual }, "Rerun accessibility scan")), status === "component-test-error" && React6.createElement(React6.Fragment, null, React6.createElement("div", null, React6.createElement("strong", null, "This story's component tests failed"), React6.createElement("p", null, "Automated accessibility tests will not run until this is resolved. You can still test manually.")), React6.createElement(Button4, { ariaLabel: !1, size: "medium", onClick: handleManual }, "Run accessibility scan"))));
|
| 2103 |
+
};
|
| 2104 |
+
|
| 2105 |
+
// src/components/VisionSimulator.tsx
|
| 2106 |
+
import React7 from "react";
|
| 2107 |
+
import { Select } from "storybook/internal/components";
|
| 2108 |
+
import { AccessibilityIcon } from "@storybook/icons";
|
| 2109 |
+
import { useGlobals as useGlobals2 } from "storybook/manager-api";
|
| 2110 |
+
import { styled as styled6 } from "storybook/theming";
|
| 2111 |
+
var Hidden = styled6.div({
|
| 2112 |
+
"&, & svg": {
|
| 2113 |
+
position: "absolute",
|
| 2114 |
+
width: 0,
|
| 2115 |
+
height: 0
|
| 2116 |
+
}
|
| 2117 |
+
}), ColorIcon = styled6.span(
|
| 2118 |
+
{
|
| 2119 |
+
background: "linear-gradient(to right, #F44336, #FF9800, #FFEB3B, #8BC34A, #2196F3, #9C27B0)",
|
| 2120 |
+
borderRadius: 14,
|
| 2121 |
+
display: "block",
|
| 2122 |
+
flexShrink: 0,
|
| 2123 |
+
height: 14,
|
| 2124 |
+
width: 14
|
| 2125 |
+
},
|
| 2126 |
+
({ $filter }) => ({
|
| 2127 |
+
filter: filters[$filter].filter || "none"
|
| 2128 |
+
}),
|
| 2129 |
+
({ theme: theme2 }) => ({
|
| 2130 |
+
boxShadow: `${theme2.appBorderColor} 0 0 0 1px inset`
|
| 2131 |
+
})
|
| 2132 |
+
), VisionSimulator = () => {
|
| 2133 |
+
let [globals, updateGlobals, storyGlobals] = useGlobals2(), value = globals[VISION_GLOBAL_KEY], isLocked = storyGlobals[VISION_GLOBAL_KEY] !== void 0, options = Object.entries(filters).map(([key, { label, percentage }]) => ({
|
| 2134 |
+
title: label,
|
| 2135 |
+
description: percentage ? `${percentage}% of users` : void 0,
|
| 2136 |
+
icon: React7.createElement(ColorIcon, { $filter: key }),
|
| 2137 |
+
value: key
|
| 2138 |
+
}));
|
| 2139 |
+
return React7.createElement(React7.Fragment, null, React7.createElement(
|
| 2140 |
+
Select,
|
| 2141 |
+
{
|
| 2142 |
+
resetLabel: "Reset color filter",
|
| 2143 |
+
onReset: () => updateGlobals({ [VISION_GLOBAL_KEY]: void 0 }),
|
| 2144 |
+
icon: React7.createElement(AccessibilityIcon, null),
|
| 2145 |
+
disabled: isLocked,
|
| 2146 |
+
ariaLabel: isLocked ? "Vision filter set by story globals" : "Vision filter",
|
| 2147 |
+
ariaDescription: "Select a vision filter among predefined options, or reset to remove the filter.",
|
| 2148 |
+
tooltip: isLocked ? "Vision filter set by story globals" : "Change vision filter",
|
| 2149 |
+
defaultOptions: value,
|
| 2150 |
+
options,
|
| 2151 |
+
onSelect: (selected) => updateGlobals({ [VISION_GLOBAL_KEY]: selected })
|
| 2152 |
+
}
|
| 2153 |
+
), React7.createElement(Hidden, { dangerouslySetInnerHTML: { __html: filterDefs } }));
|
| 2154 |
+
};
|
| 2155 |
+
|
| 2156 |
+
// src/manager.tsx
|
| 2157 |
+
var Title2 = () => {
|
| 2158 |
+
let selectedPanel = useStorybookApi3().getSelectedPanel(), [{ results }] = useAddonState2(ADDON_ID, {
|
| 2159 |
+
ui: {
|
| 2160 |
+
highlighted: !1,
|
| 2161 |
+
tab: RuleType.VIOLATION
|
| 2162 |
+
},
|
| 2163 |
+
results: void 0,
|
| 2164 |
+
error: void 0,
|
| 2165 |
+
status: "initial"
|
| 2166 |
+
}), violationsNb = results?.violations?.length ?? 0, incompleteNb = results?.incomplete?.length ?? 0, count = violationsNb + incompleteNb, suffix = count === 0 ? null : React8.createElement(Badge3, { compact: !0, status: selectedPanel === PANEL_ID ? "active" : "neutral" }, count);
|
| 2167 |
+
return React8.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6 } }, React8.createElement("span", null, "Accessibility"), suffix);
|
| 2168 |
+
};
|
| 2169 |
+
addons.register(ADDON_ID, (api) => {
|
| 2170 |
+
addons.add(PANEL_ID, {
|
| 2171 |
+
title: "",
|
| 2172 |
+
type: types.TOOL,
|
| 2173 |
+
match: ({ viewMode, tabId }) => viewMode === "story" && !tabId,
|
| 2174 |
+
render: () => React8.createElement(VisionSimulator, null)
|
| 2175 |
+
}), addons.add(PANEL_ID, {
|
| 2176 |
+
title: Title2,
|
| 2177 |
+
type: types.PANEL,
|
| 2178 |
+
render: ({ active = !0 }) => React8.createElement(A11yContextProvider, null, active ? React8.createElement(A11YPanel, null) : null),
|
| 2179 |
+
paramKey: PARAM_KEY
|
| 2180 |
+
});
|
| 2181 |
+
});
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/postinstall.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import CJS_COMPAT_NODE_URL_3n95zh6obwk from 'node:url';
|
| 2 |
+
import CJS_COMPAT_NODE_PATH_3n95zh6obwk from 'node:path';
|
| 3 |
+
import CJS_COMPAT_NODE_MODULE_3n95zh6obwk from "node:module";
|
| 4 |
+
|
| 5 |
+
var __filename = CJS_COMPAT_NODE_URL_3n95zh6obwk.fileURLToPath(import.meta.url);
|
| 6 |
+
var __dirname = CJS_COMPAT_NODE_PATH_3n95zh6obwk.dirname(__filename);
|
| 7 |
+
var require = CJS_COMPAT_NODE_MODULE_3n95zh6obwk.createRequire(import.meta.url);
|
| 8 |
+
|
| 9 |
+
// ------------------------------------------------------------
|
| 10 |
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
| 11 |
+
// ------------------------------------------------------------
|
| 12 |
+
|
| 13 |
+
// src/postinstall.ts
|
| 14 |
+
import { JsPackageManagerFactory } from "storybook/internal/common";
|
| 15 |
+
async function postinstall(options) {
|
| 16 |
+
let args = ["storybook", "automigrate", "addon-a11y-addon-test"];
|
| 17 |
+
args.push("--loglevel", "silent"), args.push("--skip-doctor"), options.yes && args.push("--yes"), options.packageManager && args.push("--package-manager", options.packageManager), options.configDir && args.push("--config-dir", options.configDir), await JsPackageManagerFactory.getPackageManager({
|
| 18 |
+
force: options.packageManager,
|
| 19 |
+
configDir: options.configDir
|
| 20 |
+
}).runPackageCommand({ args });
|
| 21 |
+
}
|
| 22 |
+
export {
|
| 23 |
+
postinstall as default
|
| 24 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/preview.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as storybook_internal_csf from 'storybook/internal/csf';
|
| 2 |
+
import { AfterEach } from 'storybook/internal/types';
|
| 3 |
+
import { Selector, SelectorList, RunOptions, Spec } from 'axe-core';
|
| 4 |
+
|
| 5 |
+
type SelectorWithoutNode = Omit<Selector, 'Node'> | Omit<SelectorList, 'NodeList'>;
|
| 6 |
+
type ContextObjectWithoutNode = {
|
| 7 |
+
include: SelectorWithoutNode;
|
| 8 |
+
exclude?: SelectorWithoutNode;
|
| 9 |
+
} | {
|
| 10 |
+
exclude: SelectorWithoutNode;
|
| 11 |
+
include?: SelectorWithoutNode;
|
| 12 |
+
};
|
| 13 |
+
type ContextSpecWithoutNode = SelectorWithoutNode | ContextObjectWithoutNode;
|
| 14 |
+
type A11yTest = 'off' | 'todo' | 'error';
|
| 15 |
+
interface A11yParameters {
|
| 16 |
+
/**
|
| 17 |
+
* Context parameter for axe-core's run function, except without support for passing Nodes and
|
| 18 |
+
* NodeLists directly.
|
| 19 |
+
*
|
| 20 |
+
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/context.md
|
| 21 |
+
*/
|
| 22 |
+
context?: ContextSpecWithoutNode;
|
| 23 |
+
/**
|
| 24 |
+
* Options for running axe-core.
|
| 25 |
+
*
|
| 26 |
+
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#options-parameter
|
| 27 |
+
*/
|
| 28 |
+
options?: RunOptions;
|
| 29 |
+
/**
|
| 30 |
+
* Configuration object for axe-core.
|
| 31 |
+
*
|
| 32 |
+
* @see https://github.com/dequelabs/axe-core/blob/develop/doc/API.md#api-name-axeconfigure
|
| 33 |
+
*/
|
| 34 |
+
config?: Spec;
|
| 35 |
+
/** Whether to disable accessibility tests. */
|
| 36 |
+
disable?: boolean;
|
| 37 |
+
/** Defines how accessibility violations should be handled: 'off', 'todo', or 'error'. */
|
| 38 |
+
test?: A11yTest;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
declare const decorators: storybook_internal_csf.DecoratorFunction[];
|
| 42 |
+
declare const afterEach: AfterEach<any>;
|
| 43 |
+
declare const initialGlobals: {
|
| 44 |
+
a11y: {
|
| 45 |
+
manual: boolean;
|
| 46 |
+
};
|
| 47 |
+
vision: undefined;
|
| 48 |
+
};
|
| 49 |
+
declare const parameters: {
|
| 50 |
+
a11y: A11yParameters;
|
| 51 |
+
};
|
| 52 |
+
|
| 53 |
+
export { afterEach, decorators, initialGlobals, parameters };
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-a11y/dist/preview.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import {
|
| 2 |
+
afterEach,
|
| 3 |
+
decorators,
|
| 4 |
+
initialGlobals,
|
| 5 |
+
parameters
|
| 6 |
+
} from "./_browser-chunks/chunk-2FVV6YOY.js";
|
| 7 |
+
import "./_browser-chunks/chunk-7OPMK7TU.js";
|
| 8 |
+
import "./_browser-chunks/chunk-4BE7D4DS.js";
|
| 9 |
+
export {
|
| 10 |
+
afterEach,
|
| 11 |
+
decorators,
|
| 12 |
+
initialGlobals,
|
| 13 |
+
parameters
|
| 14 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/README.md
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<center>
|
| 2 |
+
<img src="https://raw.githubusercontent.com/storybookjs/storybook/next/code/addons/docs/docs/media/hero.png" width="100%" />
|
| 3 |
+
</center>
|
| 4 |
+
|
| 5 |
+
# Storybook Docs
|
| 6 |
+
|
| 7 |
+
> migration guide: This page documents the method to configure Storybook introduced recently in 7.0.0, consult the [migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md) if you want to migrate to this format of configuring Storybook.
|
| 8 |
+
|
| 9 |
+
Storybook Docs transforms your Storybook stories into world-class component documentation.
|
| 10 |
+
|
| 11 |
+
**DocsPage.** Out of the box, all your stories get a `DocsPage`. `DocsPage` is a zero-config aggregation of your component stories, text descriptions, docgen comments, props tables, and code examples into clean, readable pages.
|
| 12 |
+
|
| 13 |
+
**MDX.** If you want more control, `MDX` allows you to write long-form markdown documentation and include stories in one file. You can also use it to write pure documentation pages and embed them inside your Storybook alongside your stories.
|
| 14 |
+
|
| 15 |
+
Just like Storybook, Docs supports every major view layer including React, Vue 3, Angular, HTML, Web components, Svelte, and many more.
|
| 16 |
+
|
| 17 |
+
Read on to learn more:
|
| 18 |
+
|
| 19 |
+
- [Storybook Docs](#storybook-docs)
|
| 20 |
+
- [DocsPage](#docspage)
|
| 21 |
+
- [MDX](#mdx)
|
| 22 |
+
- [Framework support](#framework-support)
|
| 23 |
+
- [Installation](#installation)
|
| 24 |
+
- [Be sure to check framework specific installation needs](#be-sure-to-check-framework-specific-installation-needs)
|
| 25 |
+
- [Preset options](#preset-options)
|
| 26 |
+
- [TypeScript configuration](#typescript-configuration)
|
| 27 |
+
- [More resources](#more-resources)
|
| 28 |
+
|
| 29 |
+
## DocsPage
|
| 30 |
+
|
| 31 |
+
When you [install Docs](#installation), every story gets a `DocsPage`. `DocsPage` pulls information from your stories, components, source code, and story metadata to construct a sensible, zero-config default.
|
| 32 |
+
|
| 33 |
+
Click on the `Docs` tab to see it:
|
| 34 |
+
|
| 35 |
+
<center>
|
| 36 |
+
<img src="https://raw.githubusercontent.com/storybookjs/storybook/next/code/addons/docs/docs/media/docs-tab.png" width="100%" />
|
| 37 |
+
</center>
|
| 38 |
+
|
| 39 |
+
For more information on how it works, see the [`DocsPage` reference](https://github.com/storybookjs/storybook/blob/next/code/addons/docs/docs/docspage.md).
|
| 40 |
+
|
| 41 |
+
## MDX
|
| 42 |
+
|
| 43 |
+
`MDX` is a syntax for writing long-form documentation with stories side-by-side in the same file. In contrast to `DocsPage`, which provides smart documentation out of the box, `MDX` gives you full control over your component documentation.
|
| 44 |
+
|
| 45 |
+
Here's an example file:
|
| 46 |
+
|
| 47 |
+
<!-- prettier-ignore-start -->
|
| 48 |
+
|
| 49 |
+
```md
|
| 50 |
+
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
|
| 51 |
+
import * as CheckboxStories from './Checkbox.stories';
|
| 52 |
+
|
| 53 |
+
<Meta title="MDX/Checkbox" of={CheckboxStories} />
|
| 54 |
+
|
| 55 |
+
# Checkbox
|
| 56 |
+
|
| 57 |
+
With `MDX` we can include a story for `Checkbox` right in the middle of our
|
| 58 |
+
markdown documentation.
|
| 59 |
+
|
| 60 |
+
<Canvas>
|
| 61 |
+
<Story of={CheckboxStories.Unchecked} />
|
| 62 |
+
</Canvas>
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
<!-- prettier-ignore-end -->
|
| 66 |
+
|
| 67 |
+
And here's how that's rendered in Storybook:
|
| 68 |
+
|
| 69 |
+
<center>
|
| 70 |
+
<img src="https://raw.githubusercontent.com/storybookjs/storybook/next/code/addons/docs/docs/media/mdx-simple.png" width="100%" />
|
| 71 |
+
</center>
|
| 72 |
+
|
| 73 |
+
For more information on `MDX`, see the [`MDX` reference](https://github.com/storybookjs/storybook/blob/next/code/addons/docs/docs/mdx.md).
|
| 74 |
+
|
| 75 |
+
## Framework support
|
| 76 |
+
|
| 77 |
+
Storybook Docs supports all view layers that Storybook supports except for React Native (currently). There are some framework-specific features as well, such as props tables and inline story rendering. The following page captures the current state of support:
|
| 78 |
+
|
| 79 |
+
[Framework Support](https://storybook.js.org/docs/configure/integration/frameworks-feature-support?ref=readme)
|
| 80 |
+
|
| 81 |
+
**Note:** `#` = WIP support
|
| 82 |
+
|
| 83 |
+
Want to add enhanced features to your favorite framework? Check out this [dev guide](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/multiframework.md)
|
| 84 |
+
|
| 85 |
+
## Installation
|
| 86 |
+
|
| 87 |
+
First add the package. Make sure that the versions for your `@storybook/*` packages match:
|
| 88 |
+
|
| 89 |
+
```sh
|
| 90 |
+
yarn add -D @storybook/addon-docs
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
Docs has peer dependencies on `react`. If you want to write stories in MDX, you may need to add this dependency as well:
|
| 94 |
+
|
| 95 |
+
```sh
|
| 96 |
+
yarn add -D react
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
Then add the following to your `.storybook/main.js`:
|
| 100 |
+
|
| 101 |
+
```js
|
| 102 |
+
export default {
|
| 103 |
+
stories: [
|
| 104 |
+
'../src/**/*.mdx', // 👈 Add this, to match your project's structure
|
| 105 |
+
'../src/**/*.stories.@(js|jsx|ts|tsx)',
|
| 106 |
+
],
|
| 107 |
+
addons: [
|
| 108 |
+
'@storybook/addon-docs', // 👈 Also add this
|
| 109 |
+
],
|
| 110 |
+
};
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
### Be sure to check framework specific installation needs
|
| 114 |
+
|
| 115 |
+
- [React](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/react) (covered here)
|
| 116 |
+
- [Vue 3](https://github.com/storybookjs/storybook/blob/next/code/addons/docs/vue3)
|
| 117 |
+
- [Angular](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/angular)
|
| 118 |
+
- [Ember](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/ember)
|
| 119 |
+
- [Web Components](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/web-components)
|
| 120 |
+
- [Common setup (all other frameworks)](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/common)
|
| 121 |
+
|
| 122 |
+
## Preset options
|
| 123 |
+
|
| 124 |
+
The `addon-docs` preset has a few configuration options that can be used to configure its babel/webpack loading behavior. Here's an example of how to use the preset with options:
|
| 125 |
+
|
| 126 |
+
```js
|
| 127 |
+
export default {
|
| 128 |
+
addons: [
|
| 129 |
+
{
|
| 130 |
+
name: '@storybook/addon-docs',
|
| 131 |
+
options: {
|
| 132 |
+
csfPluginOptions: null,
|
| 133 |
+
mdxPluginOptions: {},
|
| 134 |
+
},
|
| 135 |
+
},
|
| 136 |
+
],
|
| 137 |
+
};
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
`csfPluginOptions` is an object for configuring `@storybook/csf-plugin`. When set to `null` it tells docs not to run the `csf-plugin` at all, which can be used as an optimization, or if you're already using `csf-plugin` in your `main.js`.
|
| 141 |
+
|
| 142 |
+
> With the release of version 7.0, it is no longer possible to import `.md` files directly into Storybook using the `transcludeMarkdown` [option](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#importing-plain-markdown-files-with-transcludemarkdown-has-changed). Instead, we recommend using the [`Markdown`](https://storybook.js.org/docs/api/doc-blocks/doc-block-markdown?ref=readme) Doc Block for importing Markdown files into your Storybook documentation.
|
| 143 |
+
|
| 144 |
+
## TypeScript configuration
|
| 145 |
+
|
| 146 |
+
As of SB6 [TypeScript is zero-config](https://storybook.js.org/docs/configure/integration/typescript?ref=readme) and should work with SB Docs out of the box. For advanced configuration options, refer to the [Props documentation](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/props-tables.md).
|
| 147 |
+
|
| 148 |
+
## More resources
|
| 149 |
+
|
| 150 |
+
Want to learn more? Here are some more articles on Storybook Docs:
|
| 151 |
+
|
| 152 |
+
- References: [DocsPage](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/docspage.md) / [MDX](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/mdx.md) / [FAQ](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/faq.md) / [Recipes](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/recipes.md) / [Theming](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/theming.md) / [Props](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/props-tables.md)
|
| 153 |
+
- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea)
|
| 154 |
+
- Example: [Storybook Design System](https://github.com/storybookjs/design-system)
|
| 155 |
+
|
| 156 |
+
Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=readme).
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/Color-6BZIO3FS.js
ADDED
|
@@ -0,0 +1,1096 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import {
|
| 2 |
+
getControlId
|
| 3 |
+
} from "./chunk-CYSK6WYR.js";
|
| 4 |
+
import {
|
| 5 |
+
__commonJS,
|
| 6 |
+
__toESM
|
| 7 |
+
} from "./chunk-SL3VIQZ3.js";
|
| 8 |
+
|
| 9 |
+
// ../../../node_modules/color-name/index.js
|
| 10 |
+
var require_color_name = __commonJS({
|
| 11 |
+
"../../../node_modules/color-name/index.js"(exports, module) {
|
| 12 |
+
"use strict";
|
| 13 |
+
module.exports = {
|
| 14 |
+
aliceblue: [240, 248, 255],
|
| 15 |
+
antiquewhite: [250, 235, 215],
|
| 16 |
+
aqua: [0, 255, 255],
|
| 17 |
+
aquamarine: [127, 255, 212],
|
| 18 |
+
azure: [240, 255, 255],
|
| 19 |
+
beige: [245, 245, 220],
|
| 20 |
+
bisque: [255, 228, 196],
|
| 21 |
+
black: [0, 0, 0],
|
| 22 |
+
blanchedalmond: [255, 235, 205],
|
| 23 |
+
blue: [0, 0, 255],
|
| 24 |
+
blueviolet: [138, 43, 226],
|
| 25 |
+
brown: [165, 42, 42],
|
| 26 |
+
burlywood: [222, 184, 135],
|
| 27 |
+
cadetblue: [95, 158, 160],
|
| 28 |
+
chartreuse: [127, 255, 0],
|
| 29 |
+
chocolate: [210, 105, 30],
|
| 30 |
+
coral: [255, 127, 80],
|
| 31 |
+
cornflowerblue: [100, 149, 237],
|
| 32 |
+
cornsilk: [255, 248, 220],
|
| 33 |
+
crimson: [220, 20, 60],
|
| 34 |
+
cyan: [0, 255, 255],
|
| 35 |
+
darkblue: [0, 0, 139],
|
| 36 |
+
darkcyan: [0, 139, 139],
|
| 37 |
+
darkgoldenrod: [184, 134, 11],
|
| 38 |
+
darkgray: [169, 169, 169],
|
| 39 |
+
darkgreen: [0, 100, 0],
|
| 40 |
+
darkgrey: [169, 169, 169],
|
| 41 |
+
darkkhaki: [189, 183, 107],
|
| 42 |
+
darkmagenta: [139, 0, 139],
|
| 43 |
+
darkolivegreen: [85, 107, 47],
|
| 44 |
+
darkorange: [255, 140, 0],
|
| 45 |
+
darkorchid: [153, 50, 204],
|
| 46 |
+
darkred: [139, 0, 0],
|
| 47 |
+
darksalmon: [233, 150, 122],
|
| 48 |
+
darkseagreen: [143, 188, 143],
|
| 49 |
+
darkslateblue: [72, 61, 139],
|
| 50 |
+
darkslategray: [47, 79, 79],
|
| 51 |
+
darkslategrey: [47, 79, 79],
|
| 52 |
+
darkturquoise: [0, 206, 209],
|
| 53 |
+
darkviolet: [148, 0, 211],
|
| 54 |
+
deeppink: [255, 20, 147],
|
| 55 |
+
deepskyblue: [0, 191, 255],
|
| 56 |
+
dimgray: [105, 105, 105],
|
| 57 |
+
dimgrey: [105, 105, 105],
|
| 58 |
+
dodgerblue: [30, 144, 255],
|
| 59 |
+
firebrick: [178, 34, 34],
|
| 60 |
+
floralwhite: [255, 250, 240],
|
| 61 |
+
forestgreen: [34, 139, 34],
|
| 62 |
+
fuchsia: [255, 0, 255],
|
| 63 |
+
gainsboro: [220, 220, 220],
|
| 64 |
+
ghostwhite: [248, 248, 255],
|
| 65 |
+
gold: [255, 215, 0],
|
| 66 |
+
goldenrod: [218, 165, 32],
|
| 67 |
+
gray: [128, 128, 128],
|
| 68 |
+
green: [0, 128, 0],
|
| 69 |
+
greenyellow: [173, 255, 47],
|
| 70 |
+
grey: [128, 128, 128],
|
| 71 |
+
honeydew: [240, 255, 240],
|
| 72 |
+
hotpink: [255, 105, 180],
|
| 73 |
+
indianred: [205, 92, 92],
|
| 74 |
+
indigo: [75, 0, 130],
|
| 75 |
+
ivory: [255, 255, 240],
|
| 76 |
+
khaki: [240, 230, 140],
|
| 77 |
+
lavender: [230, 230, 250],
|
| 78 |
+
lavenderblush: [255, 240, 245],
|
| 79 |
+
lawngreen: [124, 252, 0],
|
| 80 |
+
lemonchiffon: [255, 250, 205],
|
| 81 |
+
lightblue: [173, 216, 230],
|
| 82 |
+
lightcoral: [240, 128, 128],
|
| 83 |
+
lightcyan: [224, 255, 255],
|
| 84 |
+
lightgoldenrodyellow: [250, 250, 210],
|
| 85 |
+
lightgray: [211, 211, 211],
|
| 86 |
+
lightgreen: [144, 238, 144],
|
| 87 |
+
lightgrey: [211, 211, 211],
|
| 88 |
+
lightpink: [255, 182, 193],
|
| 89 |
+
lightsalmon: [255, 160, 122],
|
| 90 |
+
lightseagreen: [32, 178, 170],
|
| 91 |
+
lightskyblue: [135, 206, 250],
|
| 92 |
+
lightslategray: [119, 136, 153],
|
| 93 |
+
lightslategrey: [119, 136, 153],
|
| 94 |
+
lightsteelblue: [176, 196, 222],
|
| 95 |
+
lightyellow: [255, 255, 224],
|
| 96 |
+
lime: [0, 255, 0],
|
| 97 |
+
limegreen: [50, 205, 50],
|
| 98 |
+
linen: [250, 240, 230],
|
| 99 |
+
magenta: [255, 0, 255],
|
| 100 |
+
maroon: [128, 0, 0],
|
| 101 |
+
mediumaquamarine: [102, 205, 170],
|
| 102 |
+
mediumblue: [0, 0, 205],
|
| 103 |
+
mediumorchid: [186, 85, 211],
|
| 104 |
+
mediumpurple: [147, 112, 219],
|
| 105 |
+
mediumseagreen: [60, 179, 113],
|
| 106 |
+
mediumslateblue: [123, 104, 238],
|
| 107 |
+
mediumspringgreen: [0, 250, 154],
|
| 108 |
+
mediumturquoise: [72, 209, 204],
|
| 109 |
+
mediumvioletred: [199, 21, 133],
|
| 110 |
+
midnightblue: [25, 25, 112],
|
| 111 |
+
mintcream: [245, 255, 250],
|
| 112 |
+
mistyrose: [255, 228, 225],
|
| 113 |
+
moccasin: [255, 228, 181],
|
| 114 |
+
navajowhite: [255, 222, 173],
|
| 115 |
+
navy: [0, 0, 128],
|
| 116 |
+
oldlace: [253, 245, 230],
|
| 117 |
+
olive: [128, 128, 0],
|
| 118 |
+
olivedrab: [107, 142, 35],
|
| 119 |
+
orange: [255, 165, 0],
|
| 120 |
+
orangered: [255, 69, 0],
|
| 121 |
+
orchid: [218, 112, 214],
|
| 122 |
+
palegoldenrod: [238, 232, 170],
|
| 123 |
+
palegreen: [152, 251, 152],
|
| 124 |
+
paleturquoise: [175, 238, 238],
|
| 125 |
+
palevioletred: [219, 112, 147],
|
| 126 |
+
papayawhip: [255, 239, 213],
|
| 127 |
+
peachpuff: [255, 218, 185],
|
| 128 |
+
peru: [205, 133, 63],
|
| 129 |
+
pink: [255, 192, 203],
|
| 130 |
+
plum: [221, 160, 221],
|
| 131 |
+
powderblue: [176, 224, 230],
|
| 132 |
+
purple: [128, 0, 128],
|
| 133 |
+
rebeccapurple: [102, 51, 153],
|
| 134 |
+
red: [255, 0, 0],
|
| 135 |
+
rosybrown: [188, 143, 143],
|
| 136 |
+
royalblue: [65, 105, 225],
|
| 137 |
+
saddlebrown: [139, 69, 19],
|
| 138 |
+
salmon: [250, 128, 114],
|
| 139 |
+
sandybrown: [244, 164, 96],
|
| 140 |
+
seagreen: [46, 139, 87],
|
| 141 |
+
seashell: [255, 245, 238],
|
| 142 |
+
sienna: [160, 82, 45],
|
| 143 |
+
silver: [192, 192, 192],
|
| 144 |
+
skyblue: [135, 206, 235],
|
| 145 |
+
slateblue: [106, 90, 205],
|
| 146 |
+
slategray: [112, 128, 144],
|
| 147 |
+
slategrey: [112, 128, 144],
|
| 148 |
+
snow: [255, 250, 250],
|
| 149 |
+
springgreen: [0, 255, 127],
|
| 150 |
+
steelblue: [70, 130, 180],
|
| 151 |
+
tan: [210, 180, 140],
|
| 152 |
+
teal: [0, 128, 128],
|
| 153 |
+
thistle: [216, 191, 216],
|
| 154 |
+
tomato: [255, 99, 71],
|
| 155 |
+
turquoise: [64, 224, 208],
|
| 156 |
+
violet: [238, 130, 238],
|
| 157 |
+
wheat: [245, 222, 179],
|
| 158 |
+
white: [255, 255, 255],
|
| 159 |
+
whitesmoke: [245, 245, 245],
|
| 160 |
+
yellow: [255, 255, 0],
|
| 161 |
+
yellowgreen: [154, 205, 50]
|
| 162 |
+
};
|
| 163 |
+
}
|
| 164 |
+
});
|
| 165 |
+
|
| 166 |
+
// ../../../node_modules/color-convert/conversions.js
|
| 167 |
+
var require_conversions = __commonJS({
|
| 168 |
+
"../../../node_modules/color-convert/conversions.js"(exports, module) {
|
| 169 |
+
var cssKeywords = require_color_name(), reverseKeywords = {};
|
| 170 |
+
for (let key of Object.keys(cssKeywords))
|
| 171 |
+
reverseKeywords[cssKeywords[key]] = key;
|
| 172 |
+
var convert2 = {
|
| 173 |
+
rgb: { channels: 3, labels: "rgb" },
|
| 174 |
+
hsl: { channels: 3, labels: "hsl" },
|
| 175 |
+
hsv: { channels: 3, labels: "hsv" },
|
| 176 |
+
hwb: { channels: 3, labels: "hwb" },
|
| 177 |
+
cmyk: { channels: 4, labels: "cmyk" },
|
| 178 |
+
xyz: { channels: 3, labels: "xyz" },
|
| 179 |
+
lab: { channels: 3, labels: "lab" },
|
| 180 |
+
lch: { channels: 3, labels: "lch" },
|
| 181 |
+
hex: { channels: 1, labels: ["hex"] },
|
| 182 |
+
keyword: { channels: 1, labels: ["keyword"] },
|
| 183 |
+
ansi16: { channels: 1, labels: ["ansi16"] },
|
| 184 |
+
ansi256: { channels: 1, labels: ["ansi256"] },
|
| 185 |
+
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
| 186 |
+
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
| 187 |
+
gray: { channels: 1, labels: ["gray"] }
|
| 188 |
+
};
|
| 189 |
+
module.exports = convert2;
|
| 190 |
+
for (let model of Object.keys(convert2)) {
|
| 191 |
+
if (!("channels" in convert2[model]))
|
| 192 |
+
throw new Error("missing channels property: " + model);
|
| 193 |
+
if (!("labels" in convert2[model]))
|
| 194 |
+
throw new Error("missing channel labels property: " + model);
|
| 195 |
+
if (convert2[model].labels.length !== convert2[model].channels)
|
| 196 |
+
throw new Error("channel and label counts mismatch: " + model);
|
| 197 |
+
let { channels, labels } = convert2[model];
|
| 198 |
+
delete convert2[model].channels, delete convert2[model].labels, Object.defineProperty(convert2[model], "channels", { value: channels }), Object.defineProperty(convert2[model], "labels", { value: labels });
|
| 199 |
+
}
|
| 200 |
+
convert2.rgb.hsl = function(rgb) {
|
| 201 |
+
let r2 = rgb[0] / 255, g2 = rgb[1] / 255, b2 = rgb[2] / 255, min = Math.min(r2, g2, b2), max = Math.max(r2, g2, b2), delta = max - min, h2, s2;
|
| 202 |
+
max === min ? h2 = 0 : r2 === max ? h2 = (g2 - b2) / delta : g2 === max ? h2 = 2 + (b2 - r2) / delta : b2 === max && (h2 = 4 + (r2 - g2) / delta), h2 = Math.min(h2 * 60, 360), h2 < 0 && (h2 += 360);
|
| 203 |
+
let l2 = (min + max) / 2;
|
| 204 |
+
return max === min ? s2 = 0 : l2 <= 0.5 ? s2 = delta / (max + min) : s2 = delta / (2 - max - min), [h2, s2 * 100, l2 * 100];
|
| 205 |
+
};
|
| 206 |
+
convert2.rgb.hsv = function(rgb) {
|
| 207 |
+
let rdif, gdif, bdif, h2, s2, r2 = rgb[0] / 255, g2 = rgb[1] / 255, b2 = rgb[2] / 255, v2 = Math.max(r2, g2, b2), diff = v2 - Math.min(r2, g2, b2), diffc = function(c2) {
|
| 208 |
+
return (v2 - c2) / 6 / diff + 1 / 2;
|
| 209 |
+
};
|
| 210 |
+
return diff === 0 ? (h2 = 0, s2 = 0) : (s2 = diff / v2, rdif = diffc(r2), gdif = diffc(g2), bdif = diffc(b2), r2 === v2 ? h2 = bdif - gdif : g2 === v2 ? h2 = 1 / 3 + rdif - bdif : b2 === v2 && (h2 = 2 / 3 + gdif - rdif), h2 < 0 ? h2 += 1 : h2 > 1 && (h2 -= 1)), [
|
| 211 |
+
h2 * 360,
|
| 212 |
+
s2 * 100,
|
| 213 |
+
v2 * 100
|
| 214 |
+
];
|
| 215 |
+
};
|
| 216 |
+
convert2.rgb.hwb = function(rgb) {
|
| 217 |
+
let r2 = rgb[0], g2 = rgb[1], b2 = rgb[2], h2 = convert2.rgb.hsl(rgb)[0], w2 = 1 / 255 * Math.min(r2, Math.min(g2, b2));
|
| 218 |
+
return b2 = 1 - 1 / 255 * Math.max(r2, Math.max(g2, b2)), [h2, w2 * 100, b2 * 100];
|
| 219 |
+
};
|
| 220 |
+
convert2.rgb.cmyk = function(rgb) {
|
| 221 |
+
let r2 = rgb[0] / 255, g2 = rgb[1] / 255, b2 = rgb[2] / 255, k2 = Math.min(1 - r2, 1 - g2, 1 - b2), c2 = (1 - r2 - k2) / (1 - k2) || 0, m2 = (1 - g2 - k2) / (1 - k2) || 0, y2 = (1 - b2 - k2) / (1 - k2) || 0;
|
| 222 |
+
return [c2 * 100, m2 * 100, y2 * 100, k2 * 100];
|
| 223 |
+
};
|
| 224 |
+
function comparativeDistance(x2, y2) {
|
| 225 |
+
return (x2[0] - y2[0]) ** 2 + (x2[1] - y2[1]) ** 2 + (x2[2] - y2[2]) ** 2;
|
| 226 |
+
}
|
| 227 |
+
convert2.rgb.keyword = function(rgb) {
|
| 228 |
+
let reversed = reverseKeywords[rgb];
|
| 229 |
+
if (reversed)
|
| 230 |
+
return reversed;
|
| 231 |
+
let currentClosestDistance = 1 / 0, currentClosestKeyword;
|
| 232 |
+
for (let keyword of Object.keys(cssKeywords)) {
|
| 233 |
+
let value = cssKeywords[keyword], distance = comparativeDistance(rgb, value);
|
| 234 |
+
distance < currentClosestDistance && (currentClosestDistance = distance, currentClosestKeyword = keyword);
|
| 235 |
+
}
|
| 236 |
+
return currentClosestKeyword;
|
| 237 |
+
};
|
| 238 |
+
convert2.keyword.rgb = function(keyword) {
|
| 239 |
+
return cssKeywords[keyword];
|
| 240 |
+
};
|
| 241 |
+
convert2.rgb.xyz = function(rgb) {
|
| 242 |
+
let r2 = rgb[0] / 255, g2 = rgb[1] / 255, b2 = rgb[2] / 255;
|
| 243 |
+
r2 = r2 > 0.04045 ? ((r2 + 0.055) / 1.055) ** 2.4 : r2 / 12.92, g2 = g2 > 0.04045 ? ((g2 + 0.055) / 1.055) ** 2.4 : g2 / 12.92, b2 = b2 > 0.04045 ? ((b2 + 0.055) / 1.055) ** 2.4 : b2 / 12.92;
|
| 244 |
+
let x2 = r2 * 0.4124 + g2 * 0.3576 + b2 * 0.1805, y2 = r2 * 0.2126 + g2 * 0.7152 + b2 * 0.0722, z2 = r2 * 0.0193 + g2 * 0.1192 + b2 * 0.9505;
|
| 245 |
+
return [x2 * 100, y2 * 100, z2 * 100];
|
| 246 |
+
};
|
| 247 |
+
convert2.rgb.lab = function(rgb) {
|
| 248 |
+
let xyz = convert2.rgb.xyz(rgb), x2 = xyz[0], y2 = xyz[1], z2 = xyz[2];
|
| 249 |
+
x2 /= 95.047, y2 /= 100, z2 /= 108.883, x2 = x2 > 8856e-6 ? x2 ** (1 / 3) : 7.787 * x2 + 16 / 116, y2 = y2 > 8856e-6 ? y2 ** (1 / 3) : 7.787 * y2 + 16 / 116, z2 = z2 > 8856e-6 ? z2 ** (1 / 3) : 7.787 * z2 + 16 / 116;
|
| 250 |
+
let l2 = 116 * y2 - 16, a2 = 500 * (x2 - y2), b2 = 200 * (y2 - z2);
|
| 251 |
+
return [l2, a2, b2];
|
| 252 |
+
};
|
| 253 |
+
convert2.hsl.rgb = function(hsl) {
|
| 254 |
+
let h2 = hsl[0] / 360, s2 = hsl[1] / 100, l2 = hsl[2] / 100, t2, t3, val;
|
| 255 |
+
if (s2 === 0)
|
| 256 |
+
return val = l2 * 255, [val, val, val];
|
| 257 |
+
l2 < 0.5 ? t2 = l2 * (1 + s2) : t2 = l2 + s2 - l2 * s2;
|
| 258 |
+
let t1 = 2 * l2 - t2, rgb = [0, 0, 0];
|
| 259 |
+
for (let i2 = 0; i2 < 3; i2++)
|
| 260 |
+
t3 = h2 + 1 / 3 * -(i2 - 1), t3 < 0 && t3++, t3 > 1 && t3--, 6 * t3 < 1 ? val = t1 + (t2 - t1) * 6 * t3 : 2 * t3 < 1 ? val = t2 : 3 * t3 < 2 ? val = t1 + (t2 - t1) * (2 / 3 - t3) * 6 : val = t1, rgb[i2] = val * 255;
|
| 261 |
+
return rgb;
|
| 262 |
+
};
|
| 263 |
+
convert2.hsl.hsv = function(hsl) {
|
| 264 |
+
let h2 = hsl[0], s2 = hsl[1] / 100, l2 = hsl[2] / 100, smin = s2, lmin = Math.max(l2, 0.01);
|
| 265 |
+
l2 *= 2, s2 *= l2 <= 1 ? l2 : 2 - l2, smin *= lmin <= 1 ? lmin : 2 - lmin;
|
| 266 |
+
let v2 = (l2 + s2) / 2, sv = l2 === 0 ? 2 * smin / (lmin + smin) : 2 * s2 / (l2 + s2);
|
| 267 |
+
return [h2, sv * 100, v2 * 100];
|
| 268 |
+
};
|
| 269 |
+
convert2.hsv.rgb = function(hsv) {
|
| 270 |
+
let h2 = hsv[0] / 60, s2 = hsv[1] / 100, v2 = hsv[2] / 100, hi = Math.floor(h2) % 6, f2 = h2 - Math.floor(h2), p2 = 255 * v2 * (1 - s2), q2 = 255 * v2 * (1 - s2 * f2), t2 = 255 * v2 * (1 - s2 * (1 - f2));
|
| 271 |
+
switch (v2 *= 255, hi) {
|
| 272 |
+
case 0:
|
| 273 |
+
return [v2, t2, p2];
|
| 274 |
+
case 1:
|
| 275 |
+
return [q2, v2, p2];
|
| 276 |
+
case 2:
|
| 277 |
+
return [p2, v2, t2];
|
| 278 |
+
case 3:
|
| 279 |
+
return [p2, q2, v2];
|
| 280 |
+
case 4:
|
| 281 |
+
return [t2, p2, v2];
|
| 282 |
+
case 5:
|
| 283 |
+
return [v2, p2, q2];
|
| 284 |
+
}
|
| 285 |
+
};
|
| 286 |
+
convert2.hsv.hsl = function(hsv) {
|
| 287 |
+
let h2 = hsv[0], s2 = hsv[1] / 100, v2 = hsv[2] / 100, vmin = Math.max(v2, 0.01), sl, l2;
|
| 288 |
+
l2 = (2 - s2) * v2;
|
| 289 |
+
let lmin = (2 - s2) * vmin;
|
| 290 |
+
return sl = s2 * vmin, sl /= lmin <= 1 ? lmin : 2 - lmin, sl = sl || 0, l2 /= 2, [h2, sl * 100, l2 * 100];
|
| 291 |
+
};
|
| 292 |
+
convert2.hwb.rgb = function(hwb) {
|
| 293 |
+
let h2 = hwb[0] / 360, wh = hwb[1] / 100, bl = hwb[2] / 100, ratio = wh + bl, f2;
|
| 294 |
+
ratio > 1 && (wh /= ratio, bl /= ratio);
|
| 295 |
+
let i2 = Math.floor(6 * h2), v2 = 1 - bl;
|
| 296 |
+
f2 = 6 * h2 - i2, (i2 & 1) !== 0 && (f2 = 1 - f2);
|
| 297 |
+
let n2 = wh + f2 * (v2 - wh), r2, g2, b2;
|
| 298 |
+
switch (i2) {
|
| 299 |
+
default:
|
| 300 |
+
case 6:
|
| 301 |
+
case 0:
|
| 302 |
+
r2 = v2, g2 = n2, b2 = wh;
|
| 303 |
+
break;
|
| 304 |
+
case 1:
|
| 305 |
+
r2 = n2, g2 = v2, b2 = wh;
|
| 306 |
+
break;
|
| 307 |
+
case 2:
|
| 308 |
+
r2 = wh, g2 = v2, b2 = n2;
|
| 309 |
+
break;
|
| 310 |
+
case 3:
|
| 311 |
+
r2 = wh, g2 = n2, b2 = v2;
|
| 312 |
+
break;
|
| 313 |
+
case 4:
|
| 314 |
+
r2 = n2, g2 = wh, b2 = v2;
|
| 315 |
+
break;
|
| 316 |
+
case 5:
|
| 317 |
+
r2 = v2, g2 = wh, b2 = n2;
|
| 318 |
+
break;
|
| 319 |
+
}
|
| 320 |
+
return [r2 * 255, g2 * 255, b2 * 255];
|
| 321 |
+
};
|
| 322 |
+
convert2.cmyk.rgb = function(cmyk) {
|
| 323 |
+
let c2 = cmyk[0] / 100, m2 = cmyk[1] / 100, y2 = cmyk[2] / 100, k2 = cmyk[3] / 100, r2 = 1 - Math.min(1, c2 * (1 - k2) + k2), g2 = 1 - Math.min(1, m2 * (1 - k2) + k2), b2 = 1 - Math.min(1, y2 * (1 - k2) + k2);
|
| 324 |
+
return [r2 * 255, g2 * 255, b2 * 255];
|
| 325 |
+
};
|
| 326 |
+
convert2.xyz.rgb = function(xyz) {
|
| 327 |
+
let x2 = xyz[0] / 100, y2 = xyz[1] / 100, z2 = xyz[2] / 100, r2, g2, b2;
|
| 328 |
+
return r2 = x2 * 3.2406 + y2 * -1.5372 + z2 * -0.4986, g2 = x2 * -0.9689 + y2 * 1.8758 + z2 * 0.0415, b2 = x2 * 0.0557 + y2 * -0.204 + z2 * 1.057, r2 = r2 > 31308e-7 ? 1.055 * r2 ** (1 / 2.4) - 0.055 : r2 * 12.92, g2 = g2 > 31308e-7 ? 1.055 * g2 ** (1 / 2.4) - 0.055 : g2 * 12.92, b2 = b2 > 31308e-7 ? 1.055 * b2 ** (1 / 2.4) - 0.055 : b2 * 12.92, r2 = Math.min(Math.max(0, r2), 1), g2 = Math.min(Math.max(0, g2), 1), b2 = Math.min(Math.max(0, b2), 1), [r2 * 255, g2 * 255, b2 * 255];
|
| 329 |
+
};
|
| 330 |
+
convert2.xyz.lab = function(xyz) {
|
| 331 |
+
let x2 = xyz[0], y2 = xyz[1], z2 = xyz[2];
|
| 332 |
+
x2 /= 95.047, y2 /= 100, z2 /= 108.883, x2 = x2 > 8856e-6 ? x2 ** (1 / 3) : 7.787 * x2 + 16 / 116, y2 = y2 > 8856e-6 ? y2 ** (1 / 3) : 7.787 * y2 + 16 / 116, z2 = z2 > 8856e-6 ? z2 ** (1 / 3) : 7.787 * z2 + 16 / 116;
|
| 333 |
+
let l2 = 116 * y2 - 16, a2 = 500 * (x2 - y2), b2 = 200 * (y2 - z2);
|
| 334 |
+
return [l2, a2, b2];
|
| 335 |
+
};
|
| 336 |
+
convert2.lab.xyz = function(lab) {
|
| 337 |
+
let l2 = lab[0], a2 = lab[1], b2 = lab[2], x2, y2, z2;
|
| 338 |
+
y2 = (l2 + 16) / 116, x2 = a2 / 500 + y2, z2 = y2 - b2 / 200;
|
| 339 |
+
let y22 = y2 ** 3, x22 = x2 ** 3, z22 = z2 ** 3;
|
| 340 |
+
return y2 = y22 > 8856e-6 ? y22 : (y2 - 16 / 116) / 7.787, x2 = x22 > 8856e-6 ? x22 : (x2 - 16 / 116) / 7.787, z2 = z22 > 8856e-6 ? z22 : (z2 - 16 / 116) / 7.787, x2 *= 95.047, y2 *= 100, z2 *= 108.883, [x2, y2, z2];
|
| 341 |
+
};
|
| 342 |
+
convert2.lab.lch = function(lab) {
|
| 343 |
+
let l2 = lab[0], a2 = lab[1], b2 = lab[2], h2;
|
| 344 |
+
h2 = Math.atan2(b2, a2) * 360 / 2 / Math.PI, h2 < 0 && (h2 += 360);
|
| 345 |
+
let c2 = Math.sqrt(a2 * a2 + b2 * b2);
|
| 346 |
+
return [l2, c2, h2];
|
| 347 |
+
};
|
| 348 |
+
convert2.lch.lab = function(lch) {
|
| 349 |
+
let l2 = lch[0], c2 = lch[1], hr = lch[2] / 360 * 2 * Math.PI, a2 = c2 * Math.cos(hr), b2 = c2 * Math.sin(hr);
|
| 350 |
+
return [l2, a2, b2];
|
| 351 |
+
};
|
| 352 |
+
convert2.rgb.ansi16 = function(args, saturation = null) {
|
| 353 |
+
let [r2, g2, b2] = args, value = saturation === null ? convert2.rgb.hsv(args)[2] : saturation;
|
| 354 |
+
if (value = Math.round(value / 50), value === 0)
|
| 355 |
+
return 30;
|
| 356 |
+
let ansi = 30 + (Math.round(b2 / 255) << 2 | Math.round(g2 / 255) << 1 | Math.round(r2 / 255));
|
| 357 |
+
return value === 2 && (ansi += 60), ansi;
|
| 358 |
+
};
|
| 359 |
+
convert2.hsv.ansi16 = function(args) {
|
| 360 |
+
return convert2.rgb.ansi16(convert2.hsv.rgb(args), args[2]);
|
| 361 |
+
};
|
| 362 |
+
convert2.rgb.ansi256 = function(args) {
|
| 363 |
+
let r2 = args[0], g2 = args[1], b2 = args[2];
|
| 364 |
+
return r2 === g2 && g2 === b2 ? r2 < 8 ? 16 : r2 > 248 ? 231 : Math.round((r2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(r2 / 255 * 5) + 6 * Math.round(g2 / 255 * 5) + Math.round(b2 / 255 * 5);
|
| 365 |
+
};
|
| 366 |
+
convert2.ansi16.rgb = function(args) {
|
| 367 |
+
let color = args % 10;
|
| 368 |
+
if (color === 0 || color === 7)
|
| 369 |
+
return args > 50 && (color += 3.5), color = color / 10.5 * 255, [color, color, color];
|
| 370 |
+
let mult = (~~(args > 50) + 1) * 0.5, r2 = (color & 1) * mult * 255, g2 = (color >> 1 & 1) * mult * 255, b2 = (color >> 2 & 1) * mult * 255;
|
| 371 |
+
return [r2, g2, b2];
|
| 372 |
+
};
|
| 373 |
+
convert2.ansi256.rgb = function(args) {
|
| 374 |
+
if (args >= 232) {
|
| 375 |
+
let c2 = (args - 232) * 10 + 8;
|
| 376 |
+
return [c2, c2, c2];
|
| 377 |
+
}
|
| 378 |
+
args -= 16;
|
| 379 |
+
let rem, r2 = Math.floor(args / 36) / 5 * 255, g2 = Math.floor((rem = args % 36) / 6) / 5 * 255, b2 = rem % 6 / 5 * 255;
|
| 380 |
+
return [r2, g2, b2];
|
| 381 |
+
};
|
| 382 |
+
convert2.rgb.hex = function(args) {
|
| 383 |
+
let string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
|
| 384 |
+
return "000000".substring(string.length) + string;
|
| 385 |
+
};
|
| 386 |
+
convert2.hex.rgb = function(args) {
|
| 387 |
+
let match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
| 388 |
+
if (!match)
|
| 389 |
+
return [0, 0, 0];
|
| 390 |
+
let colorString = match[0];
|
| 391 |
+
match[0].length === 3 && (colorString = colorString.split("").map((char) => char + char).join(""));
|
| 392 |
+
let integer = parseInt(colorString, 16), r2 = integer >> 16 & 255, g2 = integer >> 8 & 255, b2 = integer & 255;
|
| 393 |
+
return [r2, g2, b2];
|
| 394 |
+
};
|
| 395 |
+
convert2.rgb.hcg = function(rgb) {
|
| 396 |
+
let r2 = rgb[0] / 255, g2 = rgb[1] / 255, b2 = rgb[2] / 255, max = Math.max(Math.max(r2, g2), b2), min = Math.min(Math.min(r2, g2), b2), chroma = max - min, grayscale, hue;
|
| 397 |
+
return chroma < 1 ? grayscale = min / (1 - chroma) : grayscale = 0, chroma <= 0 ? hue = 0 : max === r2 ? hue = (g2 - b2) / chroma % 6 : max === g2 ? hue = 2 + (b2 - r2) / chroma : hue = 4 + (r2 - g2) / chroma, hue /= 6, hue %= 1, [hue * 360, chroma * 100, grayscale * 100];
|
| 398 |
+
};
|
| 399 |
+
convert2.hsl.hcg = function(hsl) {
|
| 400 |
+
let s2 = hsl[1] / 100, l2 = hsl[2] / 100, c2 = l2 < 0.5 ? 2 * s2 * l2 : 2 * s2 * (1 - l2), f2 = 0;
|
| 401 |
+
return c2 < 1 && (f2 = (l2 - 0.5 * c2) / (1 - c2)), [hsl[0], c2 * 100, f2 * 100];
|
| 402 |
+
};
|
| 403 |
+
convert2.hsv.hcg = function(hsv) {
|
| 404 |
+
let s2 = hsv[1] / 100, v2 = hsv[2] / 100, c2 = s2 * v2, f2 = 0;
|
| 405 |
+
return c2 < 1 && (f2 = (v2 - c2) / (1 - c2)), [hsv[0], c2 * 100, f2 * 100];
|
| 406 |
+
};
|
| 407 |
+
convert2.hcg.rgb = function(hcg) {
|
| 408 |
+
let h2 = hcg[0] / 360, c2 = hcg[1] / 100, g2 = hcg[2] / 100;
|
| 409 |
+
if (c2 === 0)
|
| 410 |
+
return [g2 * 255, g2 * 255, g2 * 255];
|
| 411 |
+
let pure = [0, 0, 0], hi = h2 % 1 * 6, v2 = hi % 1, w2 = 1 - v2, mg = 0;
|
| 412 |
+
switch (Math.floor(hi)) {
|
| 413 |
+
case 0:
|
| 414 |
+
pure[0] = 1, pure[1] = v2, pure[2] = 0;
|
| 415 |
+
break;
|
| 416 |
+
case 1:
|
| 417 |
+
pure[0] = w2, pure[1] = 1, pure[2] = 0;
|
| 418 |
+
break;
|
| 419 |
+
case 2:
|
| 420 |
+
pure[0] = 0, pure[1] = 1, pure[2] = v2;
|
| 421 |
+
break;
|
| 422 |
+
case 3:
|
| 423 |
+
pure[0] = 0, pure[1] = w2, pure[2] = 1;
|
| 424 |
+
break;
|
| 425 |
+
case 4:
|
| 426 |
+
pure[0] = v2, pure[1] = 0, pure[2] = 1;
|
| 427 |
+
break;
|
| 428 |
+
default:
|
| 429 |
+
pure[0] = 1, pure[1] = 0, pure[2] = w2;
|
| 430 |
+
}
|
| 431 |
+
return mg = (1 - c2) * g2, [
|
| 432 |
+
(c2 * pure[0] + mg) * 255,
|
| 433 |
+
(c2 * pure[1] + mg) * 255,
|
| 434 |
+
(c2 * pure[2] + mg) * 255
|
| 435 |
+
];
|
| 436 |
+
};
|
| 437 |
+
convert2.hcg.hsv = function(hcg) {
|
| 438 |
+
let c2 = hcg[1] / 100, g2 = hcg[2] / 100, v2 = c2 + g2 * (1 - c2), f2 = 0;
|
| 439 |
+
return v2 > 0 && (f2 = c2 / v2), [hcg[0], f2 * 100, v2 * 100];
|
| 440 |
+
};
|
| 441 |
+
convert2.hcg.hsl = function(hcg) {
|
| 442 |
+
let c2 = hcg[1] / 100, l2 = hcg[2] / 100 * (1 - c2) + 0.5 * c2, s2 = 0;
|
| 443 |
+
return l2 > 0 && l2 < 0.5 ? s2 = c2 / (2 * l2) : l2 >= 0.5 && l2 < 1 && (s2 = c2 / (2 * (1 - l2))), [hcg[0], s2 * 100, l2 * 100];
|
| 444 |
+
};
|
| 445 |
+
convert2.hcg.hwb = function(hcg) {
|
| 446 |
+
let c2 = hcg[1] / 100, g2 = hcg[2] / 100, v2 = c2 + g2 * (1 - c2);
|
| 447 |
+
return [hcg[0], (v2 - c2) * 100, (1 - v2) * 100];
|
| 448 |
+
};
|
| 449 |
+
convert2.hwb.hcg = function(hwb) {
|
| 450 |
+
let w2 = hwb[1] / 100, v2 = 1 - hwb[2] / 100, c2 = v2 - w2, g2 = 0;
|
| 451 |
+
return c2 < 1 && (g2 = (v2 - c2) / (1 - c2)), [hwb[0], c2 * 100, g2 * 100];
|
| 452 |
+
};
|
| 453 |
+
convert2.apple.rgb = function(apple) {
|
| 454 |
+
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
| 455 |
+
};
|
| 456 |
+
convert2.rgb.apple = function(rgb) {
|
| 457 |
+
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
| 458 |
+
};
|
| 459 |
+
convert2.gray.rgb = function(args) {
|
| 460 |
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
| 461 |
+
};
|
| 462 |
+
convert2.gray.hsl = function(args) {
|
| 463 |
+
return [0, 0, args[0]];
|
| 464 |
+
};
|
| 465 |
+
convert2.gray.hsv = convert2.gray.hsl;
|
| 466 |
+
convert2.gray.hwb = function(gray) {
|
| 467 |
+
return [0, 100, gray[0]];
|
| 468 |
+
};
|
| 469 |
+
convert2.gray.cmyk = function(gray) {
|
| 470 |
+
return [0, 0, 0, gray[0]];
|
| 471 |
+
};
|
| 472 |
+
convert2.gray.lab = function(gray) {
|
| 473 |
+
return [gray[0], 0, 0];
|
| 474 |
+
};
|
| 475 |
+
convert2.gray.hex = function(gray) {
|
| 476 |
+
let val = Math.round(gray[0] / 100 * 255) & 255, string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
|
| 477 |
+
return "000000".substring(string.length) + string;
|
| 478 |
+
};
|
| 479 |
+
convert2.rgb.gray = function(rgb) {
|
| 480 |
+
return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
|
| 481 |
+
};
|
| 482 |
+
}
|
| 483 |
+
});
|
| 484 |
+
|
| 485 |
+
// ../../../node_modules/color-convert/route.js
|
| 486 |
+
var require_route = __commonJS({
|
| 487 |
+
"../../../node_modules/color-convert/route.js"(exports, module) {
|
| 488 |
+
var conversions = require_conversions();
|
| 489 |
+
function buildGraph() {
|
| 490 |
+
let graph = {}, models = Object.keys(conversions);
|
| 491 |
+
for (let len = models.length, i2 = 0; i2 < len; i2++)
|
| 492 |
+
graph[models[i2]] = {
|
| 493 |
+
// http://jsperf.com/1-vs-infinity
|
| 494 |
+
// micro-opt, but this is simple.
|
| 495 |
+
distance: -1,
|
| 496 |
+
parent: null
|
| 497 |
+
};
|
| 498 |
+
return graph;
|
| 499 |
+
}
|
| 500 |
+
function deriveBFS(fromModel) {
|
| 501 |
+
let graph = buildGraph(), queue = [fromModel];
|
| 502 |
+
for (graph[fromModel].distance = 0; queue.length; ) {
|
| 503 |
+
let current = queue.pop(), adjacents = Object.keys(conversions[current]);
|
| 504 |
+
for (let len = adjacents.length, i2 = 0; i2 < len; i2++) {
|
| 505 |
+
let adjacent = adjacents[i2], node = graph[adjacent];
|
| 506 |
+
node.distance === -1 && (node.distance = graph[current].distance + 1, node.parent = current, queue.unshift(adjacent));
|
| 507 |
+
}
|
| 508 |
+
}
|
| 509 |
+
return graph;
|
| 510 |
+
}
|
| 511 |
+
function link(from, to) {
|
| 512 |
+
return function(args) {
|
| 513 |
+
return to(from(args));
|
| 514 |
+
};
|
| 515 |
+
}
|
| 516 |
+
function wrapConversion(toModel, graph) {
|
| 517 |
+
let path = [graph[toModel].parent, toModel], fn = conversions[graph[toModel].parent][toModel], cur = graph[toModel].parent;
|
| 518 |
+
for (; graph[cur].parent; )
|
| 519 |
+
path.unshift(graph[cur].parent), fn = link(conversions[graph[cur].parent][cur], fn), cur = graph[cur].parent;
|
| 520 |
+
return fn.conversion = path, fn;
|
| 521 |
+
}
|
| 522 |
+
module.exports = function(fromModel) {
|
| 523 |
+
let graph = deriveBFS(fromModel), conversion = {}, models = Object.keys(graph);
|
| 524 |
+
for (let len = models.length, i2 = 0; i2 < len; i2++) {
|
| 525 |
+
let toModel = models[i2];
|
| 526 |
+
graph[toModel].parent !== null && (conversion[toModel] = wrapConversion(toModel, graph));
|
| 527 |
+
}
|
| 528 |
+
return conversion;
|
| 529 |
+
};
|
| 530 |
+
}
|
| 531 |
+
});
|
| 532 |
+
|
| 533 |
+
// ../../../node_modules/color-convert/index.js
|
| 534 |
+
var require_color_convert = __commonJS({
|
| 535 |
+
"../../../node_modules/color-convert/index.js"(exports, module) {
|
| 536 |
+
var conversions = require_conversions(), route = require_route(), convert2 = {}, models = Object.keys(conversions);
|
| 537 |
+
function wrapRaw(fn) {
|
| 538 |
+
let wrappedFn = function(...args) {
|
| 539 |
+
let arg0 = args[0];
|
| 540 |
+
return arg0 == null ? arg0 : (arg0.length > 1 && (args = arg0), fn(args));
|
| 541 |
+
};
|
| 542 |
+
return "conversion" in fn && (wrappedFn.conversion = fn.conversion), wrappedFn;
|
| 543 |
+
}
|
| 544 |
+
function wrapRounded(fn) {
|
| 545 |
+
let wrappedFn = function(...args) {
|
| 546 |
+
let arg0 = args[0];
|
| 547 |
+
if (arg0 == null)
|
| 548 |
+
return arg0;
|
| 549 |
+
arg0.length > 1 && (args = arg0);
|
| 550 |
+
let result = fn(args);
|
| 551 |
+
if (typeof result == "object")
|
| 552 |
+
for (let len = result.length, i2 = 0; i2 < len; i2++)
|
| 553 |
+
result[i2] = Math.round(result[i2]);
|
| 554 |
+
return result;
|
| 555 |
+
};
|
| 556 |
+
return "conversion" in fn && (wrappedFn.conversion = fn.conversion), wrappedFn;
|
| 557 |
+
}
|
| 558 |
+
models.forEach((fromModel) => {
|
| 559 |
+
convert2[fromModel] = {}, Object.defineProperty(convert2[fromModel], "channels", { value: conversions[fromModel].channels }), Object.defineProperty(convert2[fromModel], "labels", { value: conversions[fromModel].labels });
|
| 560 |
+
let routes = route(fromModel);
|
| 561 |
+
Object.keys(routes).forEach((toModel) => {
|
| 562 |
+
let fn = routes[toModel];
|
| 563 |
+
convert2[fromModel][toModel] = wrapRounded(fn), convert2[fromModel][toModel].raw = wrapRaw(fn);
|
| 564 |
+
});
|
| 565 |
+
});
|
| 566 |
+
module.exports = convert2;
|
| 567 |
+
}
|
| 568 |
+
});
|
| 569 |
+
|
| 570 |
+
// src/blocks/controls/Color.tsx
|
| 571 |
+
var import_color_convert = __toESM(require_color_convert(), 1);
|
| 572 |
+
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
| 573 |
+
import { Button, Form, PopoverProvider } from "storybook/internal/components";
|
| 574 |
+
import { MarkupIcon } from "@storybook/icons";
|
| 575 |
+
|
| 576 |
+
// ../../../node_modules/es-toolkit/dist/function/debounce.mjs
|
| 577 |
+
function debounce(func, debounceMs, { signal, edges } = {}) {
|
| 578 |
+
let pendingThis, pendingArgs = null, leading = edges != null && edges.includes("leading"), trailing = edges == null || edges.includes("trailing"), invoke = () => {
|
| 579 |
+
pendingArgs !== null && (func.apply(pendingThis, pendingArgs), pendingThis = void 0, pendingArgs = null);
|
| 580 |
+
}, onTimerEnd = () => {
|
| 581 |
+
trailing && invoke(), cancel();
|
| 582 |
+
}, timeoutId = null, schedule = () => {
|
| 583 |
+
timeoutId != null && clearTimeout(timeoutId), timeoutId = setTimeout(() => {
|
| 584 |
+
timeoutId = null, onTimerEnd();
|
| 585 |
+
}, debounceMs);
|
| 586 |
+
}, cancelTimer = () => {
|
| 587 |
+
timeoutId !== null && (clearTimeout(timeoutId), timeoutId = null);
|
| 588 |
+
}, cancel = () => {
|
| 589 |
+
cancelTimer(), pendingThis = void 0, pendingArgs = null;
|
| 590 |
+
}, flush = () => {
|
| 591 |
+
invoke();
|
| 592 |
+
}, debounced = function(...args) {
|
| 593 |
+
if (signal?.aborted)
|
| 594 |
+
return;
|
| 595 |
+
pendingThis = this, pendingArgs = args;
|
| 596 |
+
let isFirstCall = timeoutId == null;
|
| 597 |
+
schedule(), leading && isFirstCall && invoke();
|
| 598 |
+
};
|
| 599 |
+
return debounced.schedule = schedule, debounced.cancel = cancel, debounced.flush = flush, signal?.addEventListener("abort", cancel, { once: !0 }), debounced;
|
| 600 |
+
}
|
| 601 |
+
|
| 602 |
+
// ../../../node_modules/es-toolkit/dist/function/partial.mjs
|
| 603 |
+
function partial(func, ...partialArgs) {
|
| 604 |
+
return partialImpl(func, placeholderSymbol, ...partialArgs);
|
| 605 |
+
}
|
| 606 |
+
function partialImpl(func, placeholder, ...partialArgs) {
|
| 607 |
+
let partialed = function(...providedArgs) {
|
| 608 |
+
let providedArgsIndex = 0, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg), remainingArgs = providedArgs.slice(providedArgsIndex);
|
| 609 |
+
return func.apply(this, substitutedArgs.concat(remainingArgs));
|
| 610 |
+
};
|
| 611 |
+
return func.prototype && (partialed.prototype = Object.create(func.prototype)), partialed;
|
| 612 |
+
}
|
| 613 |
+
var placeholderSymbol = Symbol("partial.placeholder");
|
| 614 |
+
partial.placeholder = placeholderSymbol;
|
| 615 |
+
|
| 616 |
+
// ../../../node_modules/es-toolkit/dist/function/partialRight.mjs
|
| 617 |
+
function partialRight(func, ...partialArgs) {
|
| 618 |
+
return partialRightImpl(func, placeholderSymbol2, ...partialArgs);
|
| 619 |
+
}
|
| 620 |
+
function partialRightImpl(func, placeholder, ...partialArgs) {
|
| 621 |
+
let partialedRight = function(...providedArgs) {
|
| 622 |
+
let placeholderLength = partialArgs.filter((arg) => arg === placeholder).length, rangeLength = Math.max(providedArgs.length - placeholderLength, 0), remainingArgs = providedArgs.slice(0, rangeLength), providedArgsIndex = rangeLength, substitutedArgs = partialArgs.slice().map((arg) => arg === placeholder ? providedArgs[providedArgsIndex++] : arg);
|
| 623 |
+
return func.apply(this, remainingArgs.concat(substitutedArgs));
|
| 624 |
+
};
|
| 625 |
+
return func.prototype && (partialedRight.prototype = Object.create(func.prototype)), partialedRight;
|
| 626 |
+
}
|
| 627 |
+
var placeholderSymbol2 = Symbol("partialRight.placeholder");
|
| 628 |
+
partialRight.placeholder = placeholderSymbol2;
|
| 629 |
+
|
| 630 |
+
// ../../../node_modules/es-toolkit/dist/function/retry.mjs
|
| 631 |
+
var DEFAULT_RETRIES = Number.POSITIVE_INFINITY;
|
| 632 |
+
|
| 633 |
+
// ../../../node_modules/react-colorful/dist/index.mjs
|
| 634 |
+
import e, { useRef as r, useMemo as t, useEffect as n, useState as o, useCallback as a, useLayoutEffect as l } from "react";
|
| 635 |
+
function u() {
|
| 636 |
+
return (u = Object.assign || function(e2) {
|
| 637 |
+
for (var r2 = 1; r2 < arguments.length; r2++) {
|
| 638 |
+
var t2 = arguments[r2];
|
| 639 |
+
for (var n2 in t2) Object.prototype.hasOwnProperty.call(t2, n2) && (e2[n2] = t2[n2]);
|
| 640 |
+
}
|
| 641 |
+
return e2;
|
| 642 |
+
}).apply(this, arguments);
|
| 643 |
+
}
|
| 644 |
+
function c(e2, r2) {
|
| 645 |
+
if (e2 == null) return {};
|
| 646 |
+
var t2, n2, o2 = {}, a2 = Object.keys(e2);
|
| 647 |
+
for (n2 = 0; n2 < a2.length; n2++) r2.indexOf(t2 = a2[n2]) >= 0 || (o2[t2] = e2[t2]);
|
| 648 |
+
return o2;
|
| 649 |
+
}
|
| 650 |
+
function i(e2) {
|
| 651 |
+
var t2 = r(e2), n2 = r(function(e3) {
|
| 652 |
+
t2.current && t2.current(e3);
|
| 653 |
+
});
|
| 654 |
+
return t2.current = e2, n2.current;
|
| 655 |
+
}
|
| 656 |
+
var s = function(e2, r2, t2) {
|
| 657 |
+
return r2 === void 0 && (r2 = 0), t2 === void 0 && (t2 = 1), e2 > t2 ? t2 : e2 < r2 ? r2 : e2;
|
| 658 |
+
}, f = function(e2) {
|
| 659 |
+
return "touches" in e2;
|
| 660 |
+
}, v = function(e2) {
|
| 661 |
+
return e2 && e2.ownerDocument.defaultView || self;
|
| 662 |
+
}, d = function(e2, r2, t2) {
|
| 663 |
+
var n2 = e2.getBoundingClientRect(), o2 = f(r2) ? (function(e3, r3) {
|
| 664 |
+
for (var t3 = 0; t3 < e3.length; t3++) if (e3[t3].identifier === r3) return e3[t3];
|
| 665 |
+
return e3[0];
|
| 666 |
+
})(r2.touches, t2) : r2;
|
| 667 |
+
return { left: s((o2.pageX - (n2.left + v(e2).pageXOffset)) / n2.width), top: s((o2.pageY - (n2.top + v(e2).pageYOffset)) / n2.height) };
|
| 668 |
+
}, h = function(e2) {
|
| 669 |
+
!f(e2) && e2.preventDefault();
|
| 670 |
+
}, m = e.memo(function(o2) {
|
| 671 |
+
var a2 = o2.onMove, l2 = o2.onKey, s2 = c(o2, ["onMove", "onKey"]), m2 = r(null), g2 = i(a2), p2 = i(l2), b2 = r(null), _2 = r(!1), x2 = t(function() {
|
| 672 |
+
var e2 = function(e3) {
|
| 673 |
+
h(e3), (f(e3) ? e3.touches.length > 0 : e3.buttons > 0) && m2.current ? g2(d(m2.current, e3, b2.current)) : t2(!1);
|
| 674 |
+
}, r2 = function() {
|
| 675 |
+
return t2(!1);
|
| 676 |
+
};
|
| 677 |
+
function t2(t3) {
|
| 678 |
+
var n2 = _2.current, o3 = v(m2.current), a3 = t3 ? o3.addEventListener : o3.removeEventListener;
|
| 679 |
+
a3(n2 ? "touchmove" : "mousemove", e2), a3(n2 ? "touchend" : "mouseup", r2);
|
| 680 |
+
}
|
| 681 |
+
return [function(e3) {
|
| 682 |
+
var r3 = e3.nativeEvent, n2 = m2.current;
|
| 683 |
+
if (n2 && (h(r3), !(function(e4, r4) {
|
| 684 |
+
return r4 && !f(e4);
|
| 685 |
+
})(r3, _2.current) && n2)) {
|
| 686 |
+
if (f(r3)) {
|
| 687 |
+
_2.current = !0;
|
| 688 |
+
var o3 = r3.changedTouches || [];
|
| 689 |
+
o3.length && (b2.current = o3[0].identifier);
|
| 690 |
+
}
|
| 691 |
+
n2.focus(), g2(d(n2, r3, b2.current)), t2(!0);
|
| 692 |
+
}
|
| 693 |
+
}, function(e3) {
|
| 694 |
+
var r3 = e3.which || e3.keyCode;
|
| 695 |
+
r3 < 37 || r3 > 40 || (e3.preventDefault(), p2({ left: r3 === 39 ? 0.05 : r3 === 37 ? -0.05 : 0, top: r3 === 40 ? 0.05 : r3 === 38 ? -0.05 : 0 }));
|
| 696 |
+
}, t2];
|
| 697 |
+
}, [p2, g2]), C2 = x2[0], E2 = x2[1], H2 = x2[2];
|
| 698 |
+
return n(function() {
|
| 699 |
+
return H2;
|
| 700 |
+
}, [H2]), e.createElement("div", u({}, s2, { onTouchStart: C2, onMouseDown: C2, className: "react-colorful__interactive", ref: m2, onKeyDown: E2, tabIndex: 0, role: "slider" }));
|
| 701 |
+
}), g = function(e2) {
|
| 702 |
+
return e2.filter(Boolean).join(" ");
|
| 703 |
+
}, p = function(r2) {
|
| 704 |
+
var t2 = r2.color, n2 = r2.left, o2 = r2.top, a2 = o2 === void 0 ? 0.5 : o2, l2 = g(["react-colorful__pointer", r2.className]);
|
| 705 |
+
return e.createElement("div", { className: l2, style: { top: 100 * a2 + "%", left: 100 * n2 + "%" } }, e.createElement("div", { className: "react-colorful__pointer-fill", style: { backgroundColor: t2 } }));
|
| 706 |
+
}, b = function(e2, r2, t2) {
|
| 707 |
+
return r2 === void 0 && (r2 = 0), t2 === void 0 && (t2 = Math.pow(10, r2)), Math.round(t2 * e2) / t2;
|
| 708 |
+
}, _ = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }, x = function(e2) {
|
| 709 |
+
return L(C(e2));
|
| 710 |
+
}, C = function(e2) {
|
| 711 |
+
return e2[0] === "#" && (e2 = e2.substring(1)), e2.length < 6 ? { r: parseInt(e2[0] + e2[0], 16), g: parseInt(e2[1] + e2[1], 16), b: parseInt(e2[2] + e2[2], 16), a: e2.length === 4 ? b(parseInt(e2[3] + e2[3], 16) / 255, 2) : 1 } : { r: parseInt(e2.substring(0, 2), 16), g: parseInt(e2.substring(2, 4), 16), b: parseInt(e2.substring(4, 6), 16), a: e2.length === 8 ? b(parseInt(e2.substring(6, 8), 16) / 255, 2) : 1 };
|
| 712 |
+
}, E = function(e2, r2) {
|
| 713 |
+
return r2 === void 0 && (r2 = "deg"), Number(e2) * (_[r2] || 1);
|
| 714 |
+
}, H = function(e2) {
|
| 715 |
+
var r2 = /hsla?\(?\s*(-?\d*\.?\d+)(deg|rad|grad|turn)?[,\s]+(-?\d*\.?\d+)%?[,\s]+(-?\d*\.?\d+)%?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e2);
|
| 716 |
+
return r2 ? N({ h: E(r2[1], r2[2]), s: Number(r2[3]), l: Number(r2[4]), a: r2[5] === void 0 ? 1 : Number(r2[5]) / (r2[6] ? 100 : 1) }) : { h: 0, s: 0, v: 0, a: 1 };
|
| 717 |
+
};
|
| 718 |
+
var N = function(e2) {
|
| 719 |
+
var r2 = e2.s, t2 = e2.l;
|
| 720 |
+
return { h: e2.h, s: (r2 *= (t2 < 50 ? t2 : 100 - t2) / 100) > 0 ? 2 * r2 / (t2 + r2) * 100 : 0, v: t2 + r2, a: e2.a };
|
| 721 |
+
}, w = function(e2) {
|
| 722 |
+
return K(I(e2));
|
| 723 |
+
}, y = function(e2) {
|
| 724 |
+
var r2 = e2.s, t2 = e2.v, n2 = e2.a, o2 = (200 - r2) * t2 / 100;
|
| 725 |
+
return { h: b(e2.h), s: b(o2 > 0 && o2 < 200 ? r2 * t2 / 100 / (o2 <= 100 ? o2 : 200 - o2) * 100 : 0), l: b(o2 / 2), a: b(n2, 2) };
|
| 726 |
+
}, q = function(e2) {
|
| 727 |
+
var r2 = y(e2);
|
| 728 |
+
return "hsl(" + r2.h + ", " + r2.s + "%, " + r2.l + "%)";
|
| 729 |
+
}, k = function(e2) {
|
| 730 |
+
var r2 = y(e2);
|
| 731 |
+
return "hsla(" + r2.h + ", " + r2.s + "%, " + r2.l + "%, " + r2.a + ")";
|
| 732 |
+
}, I = function(e2) {
|
| 733 |
+
var r2 = e2.h, t2 = e2.s, n2 = e2.v, o2 = e2.a;
|
| 734 |
+
r2 = r2 / 360 * 6, t2 /= 100, n2 /= 100;
|
| 735 |
+
var a2 = Math.floor(r2), l2 = n2 * (1 - t2), u2 = n2 * (1 - (r2 - a2) * t2), c2 = n2 * (1 - (1 - r2 + a2) * t2), i2 = a2 % 6;
|
| 736 |
+
return { r: b(255 * [n2, u2, l2, l2, c2, n2][i2]), g: b(255 * [c2, n2, n2, u2, l2, l2][i2]), b: b(255 * [l2, l2, c2, n2, n2, u2][i2]), a: b(o2, 2) };
|
| 737 |
+
};
|
| 738 |
+
var z = function(e2) {
|
| 739 |
+
var r2 = /rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e2);
|
| 740 |
+
return r2 ? L({ r: Number(r2[1]) / (r2[2] ? 100 / 255 : 1), g: Number(r2[3]) / (r2[4] ? 100 / 255 : 1), b: Number(r2[5]) / (r2[6] ? 100 / 255 : 1), a: r2[7] === void 0 ? 1 : Number(r2[7]) / (r2[8] ? 100 : 1) }) : { h: 0, s: 0, v: 0, a: 1 };
|
| 741 |
+
};
|
| 742 |
+
var D = function(e2) {
|
| 743 |
+
var r2 = e2.toString(16);
|
| 744 |
+
return r2.length < 2 ? "0" + r2 : r2;
|
| 745 |
+
}, K = function(e2) {
|
| 746 |
+
var r2 = e2.r, t2 = e2.g, n2 = e2.b, o2 = e2.a, a2 = o2 < 1 ? D(b(255 * o2)) : "";
|
| 747 |
+
return "#" + D(r2) + D(t2) + D(n2) + a2;
|
| 748 |
+
}, L = function(e2) {
|
| 749 |
+
var r2 = e2.r, t2 = e2.g, n2 = e2.b, o2 = e2.a, a2 = Math.max(r2, t2, n2), l2 = a2 - Math.min(r2, t2, n2), u2 = l2 ? a2 === r2 ? (t2 - n2) / l2 : a2 === t2 ? 2 + (n2 - r2) / l2 : 4 + (r2 - t2) / l2 : 0;
|
| 750 |
+
return { h: b(60 * (u2 < 0 ? u2 + 6 : u2)), s: b(a2 ? l2 / a2 * 100 : 0), v: b(a2 / 255 * 100), a: o2 };
|
| 751 |
+
};
|
| 752 |
+
var S = e.memo(function(r2) {
|
| 753 |
+
var t2 = r2.hue, n2 = r2.onChange, o2 = g(["react-colorful__hue", r2.className]);
|
| 754 |
+
return e.createElement("div", { className: o2 }, e.createElement(m, { onMove: function(e2) {
|
| 755 |
+
n2({ h: 360 * e2.left });
|
| 756 |
+
}, onKey: function(e2) {
|
| 757 |
+
n2({ h: s(t2 + 360 * e2.left, 0, 360) });
|
| 758 |
+
}, "aria-label": "Hue", "aria-valuenow": b(t2), "aria-valuemax": "360", "aria-valuemin": "0" }, e.createElement(p, { className: "react-colorful__hue-pointer", left: t2 / 360, color: q({ h: t2, s: 100, v: 100, a: 1 }) })));
|
| 759 |
+
}), T = e.memo(function(r2) {
|
| 760 |
+
var t2 = r2.hsva, n2 = r2.onChange, o2 = { backgroundColor: q({ h: t2.h, s: 100, v: 100, a: 1 }) };
|
| 761 |
+
return e.createElement("div", { className: "react-colorful__saturation", style: o2 }, e.createElement(m, { onMove: function(e2) {
|
| 762 |
+
n2({ s: 100 * e2.left, v: 100 - 100 * e2.top });
|
| 763 |
+
}, onKey: function(e2) {
|
| 764 |
+
n2({ s: s(t2.s + 100 * e2.left, 0, 100), v: s(t2.v - 100 * e2.top, 0, 100) });
|
| 765 |
+
}, "aria-label": "Color", "aria-valuetext": "Saturation " + b(t2.s) + "%, Brightness " + b(t2.v) + "%" }, e.createElement(p, { className: "react-colorful__saturation-pointer", top: 1 - t2.v / 100, left: t2.s / 100, color: q(t2) })));
|
| 766 |
+
}), F = function(e2, r2) {
|
| 767 |
+
if (e2 === r2) return !0;
|
| 768 |
+
for (var t2 in e2) if (e2[t2] !== r2[t2]) return !1;
|
| 769 |
+
return !0;
|
| 770 |
+
}, P = function(e2, r2) {
|
| 771 |
+
return e2.replace(/\s/g, "") === r2.replace(/\s/g, "");
|
| 772 |
+
}, X = function(e2, r2) {
|
| 773 |
+
return e2.toLowerCase() === r2.toLowerCase() || F(C(e2), C(r2));
|
| 774 |
+
};
|
| 775 |
+
function Y(e2, t2, l2) {
|
| 776 |
+
var u2 = i(l2), c2 = o(function() {
|
| 777 |
+
return e2.toHsva(t2);
|
| 778 |
+
}), s2 = c2[0], f2 = c2[1], v2 = r({ color: t2, hsva: s2 });
|
| 779 |
+
n(function() {
|
| 780 |
+
if (!e2.equal(t2, v2.current.color)) {
|
| 781 |
+
var r2 = e2.toHsva(t2);
|
| 782 |
+
v2.current = { hsva: r2, color: t2 }, f2(r2);
|
| 783 |
+
}
|
| 784 |
+
}, [t2, e2]), n(function() {
|
| 785 |
+
var r2;
|
| 786 |
+
F(s2, v2.current.hsva) || e2.equal(r2 = e2.fromHsva(s2), v2.current.color) || (v2.current = { hsva: s2, color: r2 }, u2(r2));
|
| 787 |
+
}, [s2, e2, u2]);
|
| 788 |
+
var d2 = a(function(e3) {
|
| 789 |
+
f2(function(r2) {
|
| 790 |
+
return Object.assign({}, r2, e3);
|
| 791 |
+
});
|
| 792 |
+
}, []);
|
| 793 |
+
return [s2, d2];
|
| 794 |
+
}
|
| 795 |
+
var R, V = typeof window < "u" ? l : n, $ = function() {
|
| 796 |
+
return R || (typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : void 0);
|
| 797 |
+
};
|
| 798 |
+
var J = /* @__PURE__ */ new Map(), Q = function(e2) {
|
| 799 |
+
V(function() {
|
| 800 |
+
var r2 = e2.current ? e2.current.ownerDocument : document;
|
| 801 |
+
if (r2 !== void 0 && !J.has(r2)) {
|
| 802 |
+
var t2 = r2.createElement("style");
|
| 803 |
+
t2.innerHTML = `.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`, J.set(r2, t2);
|
| 804 |
+
var n2 = $();
|
| 805 |
+
n2 && t2.setAttribute("nonce", n2), r2.head.appendChild(t2);
|
| 806 |
+
}
|
| 807 |
+
}, []);
|
| 808 |
+
}, U = function(t2) {
|
| 809 |
+
var n2 = t2.className, o2 = t2.colorModel, a2 = t2.color, l2 = a2 === void 0 ? o2.defaultColor : a2, i2 = t2.onChange, s2 = c(t2, ["className", "colorModel", "color", "onChange"]), f2 = r(null);
|
| 810 |
+
Q(f2);
|
| 811 |
+
var v2 = Y(o2, l2, i2), d2 = v2[0], h2 = v2[1], m2 = g(["react-colorful", n2]);
|
| 812 |
+
return e.createElement("div", u({}, s2, { ref: f2, className: m2 }), e.createElement(T, { hsva: d2, onChange: h2 }), e.createElement(S, { hue: d2.h, onChange: h2, className: "react-colorful__last-control" }));
|
| 813 |
+
}, W = { defaultColor: "000", toHsva: x, fromHsva: function(e2) {
|
| 814 |
+
return w({ h: e2.h, s: e2.s, v: e2.v, a: 1 });
|
| 815 |
+
}, equal: X }, Z = function(r2) {
|
| 816 |
+
return e.createElement(U, u({}, r2, { colorModel: W }));
|
| 817 |
+
}, ee = function(r2) {
|
| 818 |
+
var t2 = r2.className, n2 = r2.hsva, o2 = r2.onChange, a2 = { backgroundImage: "linear-gradient(90deg, " + k(Object.assign({}, n2, { a: 0 })) + ", " + k(Object.assign({}, n2, { a: 1 })) + ")" }, l2 = g(["react-colorful__alpha", t2]), u2 = b(100 * n2.a);
|
| 819 |
+
return e.createElement("div", { className: l2 }, e.createElement("div", { className: "react-colorful__alpha-gradient", style: a2 }), e.createElement(m, { onMove: function(e2) {
|
| 820 |
+
o2({ a: e2.left });
|
| 821 |
+
}, onKey: function(e2) {
|
| 822 |
+
o2({ a: s(n2.a + e2.left) });
|
| 823 |
+
}, "aria-label": "Alpha", "aria-valuetext": u2 + "%", "aria-valuenow": u2, "aria-valuemin": "0", "aria-valuemax": "100" }, e.createElement(p, { className: "react-colorful__alpha-pointer", left: n2.a, color: k(n2) })));
|
| 824 |
+
}, re = function(t2) {
|
| 825 |
+
var n2 = t2.className, o2 = t2.colorModel, a2 = t2.color, l2 = a2 === void 0 ? o2.defaultColor : a2, i2 = t2.onChange, s2 = c(t2, ["className", "colorModel", "color", "onChange"]), f2 = r(null);
|
| 826 |
+
Q(f2);
|
| 827 |
+
var v2 = Y(o2, l2, i2), d2 = v2[0], h2 = v2[1], m2 = g(["react-colorful", n2]);
|
| 828 |
+
return e.createElement("div", u({}, s2, { ref: f2, className: m2 }), e.createElement(T, { hsva: d2, onChange: h2 }), e.createElement(S, { hue: d2.h, onChange: h2 }), e.createElement(ee, { hsva: d2, onChange: h2, className: "react-colorful__last-control" }));
|
| 829 |
+
};
|
| 830 |
+
var le = { defaultColor: "hsla(0, 0%, 0%, 1)", toHsva: H, fromHsva: k, equal: P }, ue = function(r2) {
|
| 831 |
+
return e.createElement(re, u({}, r2, { colorModel: le }));
|
| 832 |
+
};
|
| 833 |
+
var Ee = { defaultColor: "rgba(0, 0, 0, 1)", toHsva: z, fromHsva: function(e2) {
|
| 834 |
+
var r2 = I(e2);
|
| 835 |
+
return "rgba(" + r2.r + ", " + r2.g + ", " + r2.b + ", " + r2.a + ")";
|
| 836 |
+
}, equal: P }, He = function(r2) {
|
| 837 |
+
return e.createElement(re, u({}, r2, { colorModel: Ee }));
|
| 838 |
+
};
|
| 839 |
+
|
| 840 |
+
// src/blocks/controls/Color.tsx
|
| 841 |
+
import { styled } from "storybook/theming";
|
| 842 |
+
var Wrapper = styled.div({
|
| 843 |
+
position: "relative",
|
| 844 |
+
maxWidth: 250
|
| 845 |
+
}), TooltipContent = styled.div({
|
| 846 |
+
width: 200,
|
| 847 |
+
margin: 5,
|
| 848 |
+
".react-colorful__saturation": {
|
| 849 |
+
borderRadius: "4px 4px 0 0"
|
| 850 |
+
},
|
| 851 |
+
".react-colorful__hue": {
|
| 852 |
+
boxShadow: "inset 0 0 0 1px rgb(0 0 0 / 5%)"
|
| 853 |
+
},
|
| 854 |
+
".react-colorful__last-control": {
|
| 855 |
+
borderRadius: "0 0 4px 4px"
|
| 856 |
+
}
|
| 857 |
+
}), Swatches = styled.div({
|
| 858 |
+
display: "grid",
|
| 859 |
+
gridTemplateColumns: "repeat(9, 16px)",
|
| 860 |
+
gap: 6,
|
| 861 |
+
padding: 3,
|
| 862 |
+
marginTop: 5,
|
| 863 |
+
width: 200
|
| 864 |
+
}), swatchBackground = (isDark) => `url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity="0.05" fill="${isDark ? "white" : "black"}"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')`, SwatchColor = styled(Button)(
|
| 865 |
+
({ value, selected, theme }) => ({
|
| 866 |
+
width: 16,
|
| 867 |
+
height: 16,
|
| 868 |
+
boxShadow: selected ? `${theme.appBorderColor} 0 0 0 1px inset, ${theme.textMutedColor}50 0 0 0 4px` : `${theme.appBorderColor} 0 0 0 1px inset`,
|
| 869 |
+
border: "none",
|
| 870 |
+
borderRadius: theme.appBorderRadius,
|
| 871 |
+
"&, &:hover": {
|
| 872 |
+
background: "unset",
|
| 873 |
+
backgroundColor: "unset",
|
| 874 |
+
backgroundImage: `linear-gradient(${value}, ${value}), ${swatchBackground(theme.base === "dark")}`
|
| 875 |
+
}
|
| 876 |
+
})
|
| 877 |
+
), Input = styled(Form.Input)(({ theme }) => ({
|
| 878 |
+
width: "100%",
|
| 879 |
+
paddingLeft: 30,
|
| 880 |
+
paddingRight: 30,
|
| 881 |
+
boxSizing: "border-box",
|
| 882 |
+
fontFamily: theme.typography.fonts.base,
|
| 883 |
+
'[aria-readonly="true"] > &': {
|
| 884 |
+
background: theme.base === "light" ? theme.color.lighter : "transparent"
|
| 885 |
+
}
|
| 886 |
+
})), PopoverTrigger = styled(SwatchColor)(({ disabled }) => ({
|
| 887 |
+
position: "absolute",
|
| 888 |
+
top: 4,
|
| 889 |
+
left: 4,
|
| 890 |
+
zIndex: 1,
|
| 891 |
+
cursor: disabled ? "not-allowed" : "pointer"
|
| 892 |
+
})), CycleColorSpaceButton = styled(Button)(({ theme }) => ({
|
| 893 |
+
position: "absolute",
|
| 894 |
+
zIndex: 1,
|
| 895 |
+
top: 6,
|
| 896 |
+
right: 7,
|
| 897 |
+
width: 20,
|
| 898 |
+
height: 20,
|
| 899 |
+
padding: 4,
|
| 900 |
+
boxSizing: "border-box",
|
| 901 |
+
cursor: "pointer",
|
| 902 |
+
color: theme.input.color
|
| 903 |
+
})), ColorSpace = /* @__PURE__ */ ((ColorSpace2) => (ColorSpace2.RGB = "rgb", ColorSpace2.HSL = "hsl", ColorSpace2.HEX = "hex", ColorSpace2))(ColorSpace || {}), COLOR_SPACES = Object.values(ColorSpace), COLOR_REGEXP = /\(([0-9]+),\s*([0-9]+)%?,\s*([0-9]+)%?,?\s*([0-9.]+)?\)/, RGB_REGEXP = /^\s*rgba?\(([0-9]+),\s*([0-9]+),\s*([0-9]+),?\s*([0-9.]+)?\)\s*$/i, HSL_REGEXP = /^\s*hsla?\(([0-9]+),\s*([0-9]+)%,\s*([0-9]+)%,?\s*([0-9.]+)?\)\s*$/i, HEX_REGEXP = /^\s*#?([0-9a-f]{3}|[0-9a-f]{6})\s*$/i, SHORTHEX_REGEXP = /^\s*#?([0-9a-f]{3})\s*$/i, ColorPicker = {
|
| 904 |
+
hex: Z,
|
| 905 |
+
rgb: He,
|
| 906 |
+
hsl: ue
|
| 907 |
+
}, fallbackColor = {
|
| 908 |
+
hex: "transparent",
|
| 909 |
+
rgb: "rgba(0, 0, 0, 0)",
|
| 910 |
+
hsl: "hsla(0, 0%, 0%, 0)"
|
| 911 |
+
}, stringToArgs = (value) => {
|
| 912 |
+
let match = value?.match(COLOR_REGEXP);
|
| 913 |
+
if (!match)
|
| 914 |
+
return [0, 0, 0, 1];
|
| 915 |
+
let [, x2, y2, z2, a2 = 1] = match;
|
| 916 |
+
return [x2, y2, z2, a2].map(Number);
|
| 917 |
+
}, parseRgb = (value) => {
|
| 918 |
+
let [r2, g2, b2, a2] = stringToArgs(value), [h2, s2, l2] = import_color_convert.default.rgb.hsl([r2, g2, b2]) || [0, 0, 0];
|
| 919 |
+
return {
|
| 920 |
+
valid: !0,
|
| 921 |
+
value,
|
| 922 |
+
keyword: import_color_convert.default.rgb.keyword([r2, g2, b2]),
|
| 923 |
+
colorSpace: "rgb" /* RGB */,
|
| 924 |
+
rgb: value,
|
| 925 |
+
hsl: `hsla(${h2}, ${s2}%, ${l2}%, ${a2})`,
|
| 926 |
+
hex: `#${import_color_convert.default.rgb.hex([r2, g2, b2]).toLowerCase()}`
|
| 927 |
+
};
|
| 928 |
+
}, parseHsl = (value) => {
|
| 929 |
+
let [h2, s2, l2, a2] = stringToArgs(value), [r2, g2, b2] = import_color_convert.default.hsl.rgb([h2, s2, l2]) || [0, 0, 0];
|
| 930 |
+
return {
|
| 931 |
+
valid: !0,
|
| 932 |
+
value,
|
| 933 |
+
keyword: import_color_convert.default.hsl.keyword([h2, s2, l2]),
|
| 934 |
+
colorSpace: "hsl" /* HSL */,
|
| 935 |
+
rgb: `rgba(${r2}, ${g2}, ${b2}, ${a2})`,
|
| 936 |
+
hsl: value,
|
| 937 |
+
hex: `#${import_color_convert.default.hsl.hex([h2, s2, l2]).toLowerCase()}`
|
| 938 |
+
};
|
| 939 |
+
}, parseHexOrKeyword = (value) => {
|
| 940 |
+
let plain = value.replace("#", ""), rgb = import_color_convert.default.keyword.rgb(plain) || import_color_convert.default.hex.rgb(plain), hsl = import_color_convert.default.rgb.hsl(rgb), mapped = value;
|
| 941 |
+
/[^#a-f0-9]/i.test(value) ? mapped = plain : HEX_REGEXP.test(value) && (mapped = `#${plain}`);
|
| 942 |
+
let valid = !0;
|
| 943 |
+
if (mapped.startsWith("#"))
|
| 944 |
+
valid = HEX_REGEXP.test(mapped);
|
| 945 |
+
else
|
| 946 |
+
try {
|
| 947 |
+
import_color_convert.default.keyword.hex(mapped);
|
| 948 |
+
} catch {
|
| 949 |
+
valid = !1;
|
| 950 |
+
}
|
| 951 |
+
return {
|
| 952 |
+
valid,
|
| 953 |
+
value: mapped,
|
| 954 |
+
keyword: import_color_convert.default.rgb.keyword(rgb),
|
| 955 |
+
colorSpace: "hex" /* HEX */,
|
| 956 |
+
rgb: `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, 1)`,
|
| 957 |
+
hsl: `hsla(${hsl[0]}, ${hsl[1]}%, ${hsl[2]}%, 1)`,
|
| 958 |
+
hex: mapped
|
| 959 |
+
};
|
| 960 |
+
}, parseValue = (value) => {
|
| 961 |
+
if (value)
|
| 962 |
+
return RGB_REGEXP.test(value) ? parseRgb(value) : HSL_REGEXP.test(value) ? parseHsl(value) : parseHexOrKeyword(value);
|
| 963 |
+
}, getRealValue = (value, color, colorSpace) => {
|
| 964 |
+
if (!value || !color?.valid)
|
| 965 |
+
return fallbackColor[colorSpace];
|
| 966 |
+
if (colorSpace !== "hex" /* HEX */)
|
| 967 |
+
return color?.[colorSpace] || fallbackColor[colorSpace];
|
| 968 |
+
if (!color.hex.startsWith("#"))
|
| 969 |
+
try {
|
| 970 |
+
return `#${import_color_convert.default.keyword.hex(color.hex)}`;
|
| 971 |
+
} catch {
|
| 972 |
+
return fallbackColor.hex;
|
| 973 |
+
}
|
| 974 |
+
let short = color.hex.match(SHORTHEX_REGEXP);
|
| 975 |
+
if (!short)
|
| 976 |
+
return HEX_REGEXP.test(color.hex) ? color.hex : fallbackColor.hex;
|
| 977 |
+
let [r2, g2, b2] = short[1].split("");
|
| 978 |
+
return `#${r2}${r2}${g2}${g2}${b2}${b2}`;
|
| 979 |
+
}, useColorInput = (initialValue, onChange) => {
|
| 980 |
+
let [value, setValue] = useState(initialValue || ""), [color, setColor] = useState(() => parseValue(value)), [colorSpace, setColorSpace] = useState(color?.colorSpace || "hex" /* HEX */);
|
| 981 |
+
useEffect(() => {
|
| 982 |
+
let nextValue = initialValue || "", nextColor = parseValue(nextValue);
|
| 983 |
+
setValue(nextValue), setColor(nextColor), setColorSpace(nextColor?.colorSpace || "hex" /* HEX */);
|
| 984 |
+
}, [initialValue]);
|
| 985 |
+
let realValue = useMemo(
|
| 986 |
+
() => getRealValue(value, color, colorSpace).toLowerCase(),
|
| 987 |
+
[value, color, colorSpace]
|
| 988 |
+
), updateValue = useCallback(
|
| 989 |
+
(update) => {
|
| 990 |
+
let parsed = parseValue(update), v2 = parsed?.value || update || "";
|
| 991 |
+
setValue(v2), v2 === "" && (setColor(void 0), onChange(void 0)), parsed && (setColor(parsed), setColorSpace(parsed.colorSpace), onChange(parsed.value));
|
| 992 |
+
},
|
| 993 |
+
[onChange]
|
| 994 |
+
), cycleColorSpace = useCallback(() => {
|
| 995 |
+
let nextIndex = (COLOR_SPACES.indexOf(colorSpace) + 1) % COLOR_SPACES.length, nextSpace = COLOR_SPACES[nextIndex];
|
| 996 |
+
setColorSpace(nextSpace);
|
| 997 |
+
let updatedValue = color?.[nextSpace] || "";
|
| 998 |
+
setValue(updatedValue), onChange(updatedValue);
|
| 999 |
+
}, [color, colorSpace, onChange]);
|
| 1000 |
+
return { value, realValue, updateValue, color, colorSpace, cycleColorSpace };
|
| 1001 |
+
}, id = (value) => value.replace(/\s*/, "").toLowerCase(), usePresets = (presetColors, currentColor, colorSpace) => {
|
| 1002 |
+
let [selectedColors, setSelectedColors] = useState(currentColor?.valid ? [currentColor] : []);
|
| 1003 |
+
useEffect(() => {
|
| 1004 |
+
currentColor === void 0 && setSelectedColors([]);
|
| 1005 |
+
}, [currentColor]);
|
| 1006 |
+
let presets = useMemo(() => (presetColors || []).map((preset) => typeof preset == "string" ? parseValue(preset) : preset.title ? { ...parseValue(preset.color), keyword: preset.title } : parseValue(preset.color)).concat(selectedColors).filter(Boolean).slice(-27), [presetColors, selectedColors]), addPreset = useCallback(
|
| 1007 |
+
(color) => {
|
| 1008 |
+
color?.valid && (presets.some(
|
| 1009 |
+
(preset) => preset && preset[colorSpace] && id(preset[colorSpace] || "") === id(color[colorSpace] || "")
|
| 1010 |
+
) || setSelectedColors((arr) => arr.concat(color)));
|
| 1011 |
+
},
|
| 1012 |
+
[colorSpace, presets]
|
| 1013 |
+
);
|
| 1014 |
+
return { presets, addPreset };
|
| 1015 |
+
}, ColorControl = ({
|
| 1016 |
+
name,
|
| 1017 |
+
value: initialValue,
|
| 1018 |
+
onChange,
|
| 1019 |
+
onFocus,
|
| 1020 |
+
onBlur,
|
| 1021 |
+
presetColors,
|
| 1022 |
+
startOpen = !1,
|
| 1023 |
+
argType
|
| 1024 |
+
}) => {
|
| 1025 |
+
let debouncedOnChange = useCallback(debounce(onChange, 200), [onChange]), { value, realValue, updateValue, color, colorSpace, cycleColorSpace } = useColorInput(
|
| 1026 |
+
initialValue,
|
| 1027 |
+
debouncedOnChange
|
| 1028 |
+
), { presets, addPreset } = usePresets(presetColors ?? [], color, colorSpace), Picker = ColorPicker[colorSpace], readOnly = !!argType?.table?.readonly, controlId = getControlId(name);
|
| 1029 |
+
return React.createElement(Wrapper, null, React.createElement("label", { htmlFor: controlId, className: "sb-sr-only" }, name), React.createElement(
|
| 1030 |
+
Input,
|
| 1031 |
+
{
|
| 1032 |
+
id: controlId,
|
| 1033 |
+
value,
|
| 1034 |
+
onChange: (e2) => updateValue(e2.target.value),
|
| 1035 |
+
onFocus: (e2) => e2.target.select(),
|
| 1036 |
+
readOnly,
|
| 1037 |
+
placeholder: "Choose color..."
|
| 1038 |
+
}
|
| 1039 |
+
), React.createElement(
|
| 1040 |
+
PopoverProvider,
|
| 1041 |
+
{
|
| 1042 |
+
defaultVisible: startOpen,
|
| 1043 |
+
visible: readOnly ? !1 : void 0,
|
| 1044 |
+
onVisibleChange: () => color && addPreset(color),
|
| 1045 |
+
popover: React.createElement(TooltipContent, null, React.createElement(
|
| 1046 |
+
Picker,
|
| 1047 |
+
{
|
| 1048 |
+
color: realValue === "transparent" ? "#000000" : realValue,
|
| 1049 |
+
onChange: updateValue,
|
| 1050 |
+
onFocus,
|
| 1051 |
+
onBlur
|
| 1052 |
+
}
|
| 1053 |
+
), presets.length > 0 && React.createElement(Swatches, null, presets.map((preset, index) => React.createElement(
|
| 1054 |
+
SwatchColor,
|
| 1055 |
+
{
|
| 1056 |
+
key: `${preset?.value || index}-${index}`,
|
| 1057 |
+
variant: "ghost",
|
| 1058 |
+
padding: "small",
|
| 1059 |
+
size: "small",
|
| 1060 |
+
ariaLabel: "Pick this color",
|
| 1061 |
+
tooltip: preset?.keyword || preset?.value || "",
|
| 1062 |
+
value: preset?.value || "",
|
| 1063 |
+
selected: !!(color && preset && preset[colorSpace] && id(preset[colorSpace] || "") === id(color[colorSpace])),
|
| 1064 |
+
onClick: () => preset && updateValue(preset.value || "")
|
| 1065 |
+
}
|
| 1066 |
+
))))
|
| 1067 |
+
},
|
| 1068 |
+
React.createElement(
|
| 1069 |
+
PopoverTrigger,
|
| 1070 |
+
{
|
| 1071 |
+
variant: "ghost",
|
| 1072 |
+
padding: "small",
|
| 1073 |
+
size: "small",
|
| 1074 |
+
ariaLabel: "Open color picker",
|
| 1075 |
+
value: realValue,
|
| 1076 |
+
style: { margin: 4 },
|
| 1077 |
+
disabled: readOnly
|
| 1078 |
+
}
|
| 1079 |
+
)
|
| 1080 |
+
), value ? React.createElement(
|
| 1081 |
+
CycleColorSpaceButton,
|
| 1082 |
+
{
|
| 1083 |
+
variant: "ghost",
|
| 1084 |
+
padding: "small",
|
| 1085 |
+
size: "small",
|
| 1086 |
+
ariaLabel: "Cycle through color spaces",
|
| 1087 |
+
disabled: readOnly,
|
| 1088 |
+
onClick: readOnly ? void 0 : cycleColorSpace
|
| 1089 |
+
},
|
| 1090 |
+
React.createElement(MarkupIcon, null)
|
| 1091 |
+
) : null);
|
| 1092 |
+
}, Color_default = ColorControl;
|
| 1093 |
+
export {
|
| 1094 |
+
ColorControl,
|
| 1095 |
+
Color_default as default
|
| 1096 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/DocsRenderer-LL677BLK.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import {
|
| 2 |
+
DocsRenderer,
|
| 3 |
+
defaultComponents
|
| 4 |
+
} from "./chunk-OATZR77O.js";
|
| 5 |
+
import "./chunk-SL3VIQZ3.js";
|
| 6 |
+
export {
|
| 7 |
+
DocsRenderer,
|
| 8 |
+
defaultComponents
|
| 9 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/chunk-AAVP3AE4.js
ADDED
|
@@ -0,0 +1,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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// src/blocks/components/Source.tsx
|
| 2 |
+
import React2 from "react";
|
| 3 |
+
import { SyntaxHighlighter } from "storybook/internal/components";
|
| 4 |
+
import {
|
| 5 |
+
ThemeProvider,
|
| 6 |
+
convert,
|
| 7 |
+
ignoreSsrWarning,
|
| 8 |
+
styled as styled2,
|
| 9 |
+
themes,
|
| 10 |
+
useTheme
|
| 11 |
+
} from "storybook/theming";
|
| 12 |
+
|
| 13 |
+
// src/blocks/components/EmptyBlock.tsx
|
| 14 |
+
import React from "react";
|
| 15 |
+
import { withReset } from "storybook/internal/components";
|
| 16 |
+
|
| 17 |
+
// ../../../node_modules/@babel/runtime/helpers/esm/extends.js
|
| 18 |
+
function _extends() {
|
| 19 |
+
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
| 20 |
+
for (var e = 1; e < arguments.length; e++) {
|
| 21 |
+
var t = arguments[e];
|
| 22 |
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
| 23 |
+
}
|
| 24 |
+
return n;
|
| 25 |
+
}, _extends.apply(null, arguments);
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
// ../../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
| 29 |
+
function _assertThisInitialized(e) {
|
| 30 |
+
if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
| 31 |
+
return e;
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
// ../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
| 35 |
+
function _setPrototypeOf(t, e) {
|
| 36 |
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
|
| 37 |
+
return t2.__proto__ = e2, t2;
|
| 38 |
+
}, _setPrototypeOf(t, e);
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
// ../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
| 42 |
+
function _inheritsLoose(t, o) {
|
| 43 |
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
|
| 44 |
+
}
|
| 45 |
+
|
| 46 |
+
// ../../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
| 47 |
+
function _getPrototypeOf(t) {
|
| 48 |
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t2) {
|
| 49 |
+
return t2.__proto__ || Object.getPrototypeOf(t2);
|
| 50 |
+
}, _getPrototypeOf(t);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
// ../../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
|
| 54 |
+
function _isNativeFunction(t) {
|
| 55 |
+
try {
|
| 56 |
+
return Function.toString.call(t).indexOf("[native code]") !== -1;
|
| 57 |
+
} catch {
|
| 58 |
+
return typeof t == "function";
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
// ../../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
|
| 63 |
+
function _isNativeReflectConstruct() {
|
| 64 |
+
try {
|
| 65 |
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
| 66 |
+
}));
|
| 67 |
+
} catch {
|
| 68 |
+
}
|
| 69 |
+
return (_isNativeReflectConstruct = function() {
|
| 70 |
+
return !!t;
|
| 71 |
+
})();
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
// ../../../node_modules/@babel/runtime/helpers/esm/construct.js
|
| 75 |
+
function _construct(t, e, r) {
|
| 76 |
+
if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
|
| 77 |
+
var o = [null];
|
| 78 |
+
o.push.apply(o, e);
|
| 79 |
+
var p = new (t.bind.apply(t, o))();
|
| 80 |
+
return r && _setPrototypeOf(p, r.prototype), p;
|
| 81 |
+
}
|
| 82 |
+
|
| 83 |
+
// ../../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
|
| 84 |
+
function _wrapNativeSuper(t) {
|
| 85 |
+
var r = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
| 86 |
+
return _wrapNativeSuper = function(t2) {
|
| 87 |
+
if (t2 === null || !_isNativeFunction(t2)) return t2;
|
| 88 |
+
if (typeof t2 != "function") throw new TypeError("Super expression must either be null or a function");
|
| 89 |
+
if (r !== void 0) {
|
| 90 |
+
if (r.has(t2)) return r.get(t2);
|
| 91 |
+
r.set(t2, Wrapper2);
|
| 92 |
+
}
|
| 93 |
+
function Wrapper2() {
|
| 94 |
+
return _construct(t2, arguments, _getPrototypeOf(this).constructor);
|
| 95 |
+
}
|
| 96 |
+
return Wrapper2.prototype = Object.create(t2.prototype, {
|
| 97 |
+
constructor: {
|
| 98 |
+
value: Wrapper2,
|
| 99 |
+
enumerable: !1,
|
| 100 |
+
writable: !0,
|
| 101 |
+
configurable: !0
|
| 102 |
+
}
|
| 103 |
+
}), _setPrototypeOf(Wrapper2, t2);
|
| 104 |
+
}, _wrapNativeSuper(t);
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
// ../../../node_modules/polished/dist/polished.esm.js
|
| 108 |
+
var ERRORS = {
|
| 109 |
+
1: `Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).
|
| 110 |
+
|
| 111 |
+
`,
|
| 112 |
+
2: `Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).
|
| 113 |
+
|
| 114 |
+
`,
|
| 115 |
+
3: `Passed an incorrect argument to a color function, please pass a string representation of a color.
|
| 116 |
+
|
| 117 |
+
`,
|
| 118 |
+
4: `Couldn't generate valid rgb string from %s, it returned %s.
|
| 119 |
+
|
| 120 |
+
`,
|
| 121 |
+
5: `Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.
|
| 122 |
+
|
| 123 |
+
`,
|
| 124 |
+
6: `Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).
|
| 125 |
+
|
| 126 |
+
`,
|
| 127 |
+
7: `Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).
|
| 128 |
+
|
| 129 |
+
`,
|
| 130 |
+
8: `Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.
|
| 131 |
+
|
| 132 |
+
`,
|
| 133 |
+
9: `Please provide a number of steps to the modularScale helper.
|
| 134 |
+
|
| 135 |
+
`,
|
| 136 |
+
10: `Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
|
| 137 |
+
|
| 138 |
+
`,
|
| 139 |
+
11: `Invalid value passed as base to modularScale, expected number or em string but got "%s"
|
| 140 |
+
|
| 141 |
+
`,
|
| 142 |
+
12: `Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.
|
| 143 |
+
|
| 144 |
+
`,
|
| 145 |
+
13: `Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.
|
| 146 |
+
|
| 147 |
+
`,
|
| 148 |
+
14: `Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.
|
| 149 |
+
|
| 150 |
+
`,
|
| 151 |
+
15: `Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.
|
| 152 |
+
|
| 153 |
+
`,
|
| 154 |
+
16: `You must provide a template to this method.
|
| 155 |
+
|
| 156 |
+
`,
|
| 157 |
+
17: `You passed an unsupported selector state to this method.
|
| 158 |
+
|
| 159 |
+
`,
|
| 160 |
+
18: `minScreen and maxScreen must be provided as stringified numbers with the same units.
|
| 161 |
+
|
| 162 |
+
`,
|
| 163 |
+
19: `fromSize and toSize must be provided as stringified numbers with the same units.
|
| 164 |
+
|
| 165 |
+
`,
|
| 166 |
+
20: `expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
|
| 167 |
+
|
| 168 |
+
`,
|
| 169 |
+
21: "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
|
| 170 |
+
22: "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
|
| 171 |
+
23: `fontFace expects a name of a font-family.
|
| 172 |
+
|
| 173 |
+
`,
|
| 174 |
+
24: `fontFace expects either the path to the font file(s) or a name of a local copy.
|
| 175 |
+
|
| 176 |
+
`,
|
| 177 |
+
25: `fontFace expects localFonts to be an array.
|
| 178 |
+
|
| 179 |
+
`,
|
| 180 |
+
26: `fontFace expects fileFormats to be an array.
|
| 181 |
+
|
| 182 |
+
`,
|
| 183 |
+
27: `radialGradient requries at least 2 color-stops to properly render.
|
| 184 |
+
|
| 185 |
+
`,
|
| 186 |
+
28: `Please supply a filename to retinaImage() as the first argument.
|
| 187 |
+
|
| 188 |
+
`,
|
| 189 |
+
29: `Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
|
| 190 |
+
|
| 191 |
+
`,
|
| 192 |
+
30: "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
|
| 193 |
+
31: `The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation
|
| 194 |
+
|
| 195 |
+
`,
|
| 196 |
+
32: `To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
|
| 197 |
+
To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')
|
| 198 |
+
|
| 199 |
+
`,
|
| 200 |
+
33: `The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation
|
| 201 |
+
|
| 202 |
+
`,
|
| 203 |
+
34: `borderRadius expects a radius value as a string or number as the second argument.
|
| 204 |
+
|
| 205 |
+
`,
|
| 206 |
+
35: `borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
|
| 207 |
+
|
| 208 |
+
`,
|
| 209 |
+
36: `Property must be a string value.
|
| 210 |
+
|
| 211 |
+
`,
|
| 212 |
+
37: `Syntax Error at %s.
|
| 213 |
+
|
| 214 |
+
`,
|
| 215 |
+
38: `Formula contains a function that needs parentheses at %s.
|
| 216 |
+
|
| 217 |
+
`,
|
| 218 |
+
39: `Formula is missing closing parenthesis at %s.
|
| 219 |
+
|
| 220 |
+
`,
|
| 221 |
+
40: `Formula has too many closing parentheses at %s.
|
| 222 |
+
|
| 223 |
+
`,
|
| 224 |
+
41: `All values in a formula must have the same unit or be unitless.
|
| 225 |
+
|
| 226 |
+
`,
|
| 227 |
+
42: `Please provide a number of steps to the modularScale helper.
|
| 228 |
+
|
| 229 |
+
`,
|
| 230 |
+
43: `Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
|
| 231 |
+
|
| 232 |
+
`,
|
| 233 |
+
44: `Invalid value passed as base to modularScale, expected number or em/rem string but got %s.
|
| 234 |
+
|
| 235 |
+
`,
|
| 236 |
+
45: `Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.
|
| 237 |
+
|
| 238 |
+
`,
|
| 239 |
+
46: `Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.
|
| 240 |
+
|
| 241 |
+
`,
|
| 242 |
+
47: `minScreen and maxScreen must be provided as stringified numbers with the same units.
|
| 243 |
+
|
| 244 |
+
`,
|
| 245 |
+
48: `fromSize and toSize must be provided as stringified numbers with the same units.
|
| 246 |
+
|
| 247 |
+
`,
|
| 248 |
+
49: `Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
|
| 249 |
+
|
| 250 |
+
`,
|
| 251 |
+
50: `Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.
|
| 252 |
+
|
| 253 |
+
`,
|
| 254 |
+
51: `Expects the first argument object to have the properties prop, fromSize, and toSize.
|
| 255 |
+
|
| 256 |
+
`,
|
| 257 |
+
52: `fontFace expects either the path to the font file(s) or a name of a local copy.
|
| 258 |
+
|
| 259 |
+
`,
|
| 260 |
+
53: `fontFace expects localFonts to be an array.
|
| 261 |
+
|
| 262 |
+
`,
|
| 263 |
+
54: `fontFace expects fileFormats to be an array.
|
| 264 |
+
|
| 265 |
+
`,
|
| 266 |
+
55: `fontFace expects a name of a font-family.
|
| 267 |
+
|
| 268 |
+
`,
|
| 269 |
+
56: `linearGradient requries at least 2 color-stops to properly render.
|
| 270 |
+
|
| 271 |
+
`,
|
| 272 |
+
57: `radialGradient requries at least 2 color-stops to properly render.
|
| 273 |
+
|
| 274 |
+
`,
|
| 275 |
+
58: `Please supply a filename to retinaImage() as the first argument.
|
| 276 |
+
|
| 277 |
+
`,
|
| 278 |
+
59: `Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
|
| 279 |
+
|
| 280 |
+
`,
|
| 281 |
+
60: "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
|
| 282 |
+
61: `Property must be a string value.
|
| 283 |
+
|
| 284 |
+
`,
|
| 285 |
+
62: `borderRadius expects a radius value as a string or number as the second argument.
|
| 286 |
+
|
| 287 |
+
`,
|
| 288 |
+
63: `borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
|
| 289 |
+
|
| 290 |
+
`,
|
| 291 |
+
64: `The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.
|
| 292 |
+
|
| 293 |
+
`,
|
| 294 |
+
65: `To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').
|
| 295 |
+
|
| 296 |
+
`,
|
| 297 |
+
66: `The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.
|
| 298 |
+
|
| 299 |
+
`,
|
| 300 |
+
67: `You must provide a template to this method.
|
| 301 |
+
|
| 302 |
+
`,
|
| 303 |
+
68: `You passed an unsupported selector state to this method.
|
| 304 |
+
|
| 305 |
+
`,
|
| 306 |
+
69: `Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.
|
| 307 |
+
|
| 308 |
+
`,
|
| 309 |
+
70: `Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.
|
| 310 |
+
|
| 311 |
+
`,
|
| 312 |
+
71: `Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.
|
| 313 |
+
|
| 314 |
+
`,
|
| 315 |
+
72: `Passed invalid base value %s to %s(), please pass a value like "12px" or 12.
|
| 316 |
+
|
| 317 |
+
`,
|
| 318 |
+
73: `Please provide a valid CSS variable.
|
| 319 |
+
|
| 320 |
+
`,
|
| 321 |
+
74: `CSS variable not found and no default was provided.
|
| 322 |
+
|
| 323 |
+
`,
|
| 324 |
+
75: `important requires a valid style object, got a %s instead.
|
| 325 |
+
|
| 326 |
+
`,
|
| 327 |
+
76: `fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.
|
| 328 |
+
|
| 329 |
+
`,
|
| 330 |
+
77: `remToPx expects a value in "rem" but you provided it in "%s".
|
| 331 |
+
|
| 332 |
+
`,
|
| 333 |
+
78: `base must be set in "px" or "%" but you set it in "%s".
|
| 334 |
+
`
|
| 335 |
+
};
|
| 336 |
+
function format() {
|
| 337 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++)
|
| 338 |
+
args[_key] = arguments[_key];
|
| 339 |
+
var a = args[0], b = [], c;
|
| 340 |
+
for (c = 1; c < args.length; c += 1)
|
| 341 |
+
b.push(args[c]);
|
| 342 |
+
return b.forEach(function(d) {
|
| 343 |
+
a = a.replace(/%[a-z]/, d);
|
| 344 |
+
}), a;
|
| 345 |
+
}
|
| 346 |
+
var PolishedError = (function(_Error) {
|
| 347 |
+
_inheritsLoose(PolishedError2, _Error);
|
| 348 |
+
function PolishedError2(code) {
|
| 349 |
+
var _this;
|
| 350 |
+
if (process.env.NODE_ENV === "production")
|
| 351 |
+
_this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this;
|
| 352 |
+
else {
|
| 353 |
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++)
|
| 354 |
+
args[_key2 - 1] = arguments[_key2];
|
| 355 |
+
_this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
|
| 356 |
+
}
|
| 357 |
+
return _assertThisInitialized(_this);
|
| 358 |
+
}
|
| 359 |
+
return PolishedError2;
|
| 360 |
+
})(_wrapNativeSuper(Error));
|
| 361 |
+
function endsWith(string, suffix) {
|
| 362 |
+
return string.substr(-suffix.length) === suffix;
|
| 363 |
+
}
|
| 364 |
+
var cssRegex$1 = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;
|
| 365 |
+
function stripUnit(value) {
|
| 366 |
+
if (typeof value != "string") return value;
|
| 367 |
+
var matchedValue = value.match(cssRegex$1);
|
| 368 |
+
return matchedValue ? parseFloat(value) : value;
|
| 369 |
+
}
|
| 370 |
+
var pxtoFactory = function(to) {
|
| 371 |
+
return function(pxval, base) {
|
| 372 |
+
base === void 0 && (base = "16px");
|
| 373 |
+
var newPxval = pxval, newBase = base;
|
| 374 |
+
if (typeof pxval == "string") {
|
| 375 |
+
if (!endsWith(pxval, "px"))
|
| 376 |
+
throw new PolishedError(69, to, pxval);
|
| 377 |
+
newPxval = stripUnit(pxval);
|
| 378 |
+
}
|
| 379 |
+
if (typeof base == "string") {
|
| 380 |
+
if (!endsWith(base, "px"))
|
| 381 |
+
throw new PolishedError(70, to, base);
|
| 382 |
+
newBase = stripUnit(base);
|
| 383 |
+
}
|
| 384 |
+
if (typeof newPxval == "string")
|
| 385 |
+
throw new PolishedError(71, pxval, to);
|
| 386 |
+
if (typeof newBase == "string")
|
| 387 |
+
throw new PolishedError(72, base, to);
|
| 388 |
+
return "" + newPxval / newBase + to;
|
| 389 |
+
};
|
| 390 |
+
}, pixelsto = pxtoFactory, em = pixelsto("em");
|
| 391 |
+
var rem = pixelsto("rem");
|
| 392 |
+
function colorToInt(color) {
|
| 393 |
+
return Math.round(color * 255);
|
| 394 |
+
}
|
| 395 |
+
function convertToInt(red, green, blue) {
|
| 396 |
+
return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
|
| 397 |
+
}
|
| 398 |
+
function hslToRgb(hue, saturation, lightness, convert2) {
|
| 399 |
+
if (convert2 === void 0 && (convert2 = convertToInt), saturation === 0)
|
| 400 |
+
return convert2(lightness, lightness, lightness);
|
| 401 |
+
var huePrime = (hue % 360 + 360) % 360 / 60, chroma = (1 - Math.abs(2 * lightness - 1)) * saturation, secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1)), red = 0, green = 0, blue = 0;
|
| 402 |
+
huePrime >= 0 && huePrime < 1 ? (red = chroma, green = secondComponent) : huePrime >= 1 && huePrime < 2 ? (red = secondComponent, green = chroma) : huePrime >= 2 && huePrime < 3 ? (green = chroma, blue = secondComponent) : huePrime >= 3 && huePrime < 4 ? (green = secondComponent, blue = chroma) : huePrime >= 4 && huePrime < 5 ? (red = secondComponent, blue = chroma) : huePrime >= 5 && huePrime < 6 && (red = chroma, blue = secondComponent);
|
| 403 |
+
var lightnessModification = lightness - chroma / 2, finalRed = red + lightnessModification, finalGreen = green + lightnessModification, finalBlue = blue + lightnessModification;
|
| 404 |
+
return convert2(finalRed, finalGreen, finalBlue);
|
| 405 |
+
}
|
| 406 |
+
var namedColorMap = {
|
| 407 |
+
aliceblue: "f0f8ff",
|
| 408 |
+
antiquewhite: "faebd7",
|
| 409 |
+
aqua: "00ffff",
|
| 410 |
+
aquamarine: "7fffd4",
|
| 411 |
+
azure: "f0ffff",
|
| 412 |
+
beige: "f5f5dc",
|
| 413 |
+
bisque: "ffe4c4",
|
| 414 |
+
black: "000",
|
| 415 |
+
blanchedalmond: "ffebcd",
|
| 416 |
+
blue: "0000ff",
|
| 417 |
+
blueviolet: "8a2be2",
|
| 418 |
+
brown: "a52a2a",
|
| 419 |
+
burlywood: "deb887",
|
| 420 |
+
cadetblue: "5f9ea0",
|
| 421 |
+
chartreuse: "7fff00",
|
| 422 |
+
chocolate: "d2691e",
|
| 423 |
+
coral: "ff7f50",
|
| 424 |
+
cornflowerblue: "6495ed",
|
| 425 |
+
cornsilk: "fff8dc",
|
| 426 |
+
crimson: "dc143c",
|
| 427 |
+
cyan: "00ffff",
|
| 428 |
+
darkblue: "00008b",
|
| 429 |
+
darkcyan: "008b8b",
|
| 430 |
+
darkgoldenrod: "b8860b",
|
| 431 |
+
darkgray: "a9a9a9",
|
| 432 |
+
darkgreen: "006400",
|
| 433 |
+
darkgrey: "a9a9a9",
|
| 434 |
+
darkkhaki: "bdb76b",
|
| 435 |
+
darkmagenta: "8b008b",
|
| 436 |
+
darkolivegreen: "556b2f",
|
| 437 |
+
darkorange: "ff8c00",
|
| 438 |
+
darkorchid: "9932cc",
|
| 439 |
+
darkred: "8b0000",
|
| 440 |
+
darksalmon: "e9967a",
|
| 441 |
+
darkseagreen: "8fbc8f",
|
| 442 |
+
darkslateblue: "483d8b",
|
| 443 |
+
darkslategray: "2f4f4f",
|
| 444 |
+
darkslategrey: "2f4f4f",
|
| 445 |
+
darkturquoise: "00ced1",
|
| 446 |
+
darkviolet: "9400d3",
|
| 447 |
+
deeppink: "ff1493",
|
| 448 |
+
deepskyblue: "00bfff",
|
| 449 |
+
dimgray: "696969",
|
| 450 |
+
dimgrey: "696969",
|
| 451 |
+
dodgerblue: "1e90ff",
|
| 452 |
+
firebrick: "b22222",
|
| 453 |
+
floralwhite: "fffaf0",
|
| 454 |
+
forestgreen: "228b22",
|
| 455 |
+
fuchsia: "ff00ff",
|
| 456 |
+
gainsboro: "dcdcdc",
|
| 457 |
+
ghostwhite: "f8f8ff",
|
| 458 |
+
gold: "ffd700",
|
| 459 |
+
goldenrod: "daa520",
|
| 460 |
+
gray: "808080",
|
| 461 |
+
green: "008000",
|
| 462 |
+
greenyellow: "adff2f",
|
| 463 |
+
grey: "808080",
|
| 464 |
+
honeydew: "f0fff0",
|
| 465 |
+
hotpink: "ff69b4",
|
| 466 |
+
indianred: "cd5c5c",
|
| 467 |
+
indigo: "4b0082",
|
| 468 |
+
ivory: "fffff0",
|
| 469 |
+
khaki: "f0e68c",
|
| 470 |
+
lavender: "e6e6fa",
|
| 471 |
+
lavenderblush: "fff0f5",
|
| 472 |
+
lawngreen: "7cfc00",
|
| 473 |
+
lemonchiffon: "fffacd",
|
| 474 |
+
lightblue: "add8e6",
|
| 475 |
+
lightcoral: "f08080",
|
| 476 |
+
lightcyan: "e0ffff",
|
| 477 |
+
lightgoldenrodyellow: "fafad2",
|
| 478 |
+
lightgray: "d3d3d3",
|
| 479 |
+
lightgreen: "90ee90",
|
| 480 |
+
lightgrey: "d3d3d3",
|
| 481 |
+
lightpink: "ffb6c1",
|
| 482 |
+
lightsalmon: "ffa07a",
|
| 483 |
+
lightseagreen: "20b2aa",
|
| 484 |
+
lightskyblue: "87cefa",
|
| 485 |
+
lightslategray: "789",
|
| 486 |
+
lightslategrey: "789",
|
| 487 |
+
lightsteelblue: "b0c4de",
|
| 488 |
+
lightyellow: "ffffe0",
|
| 489 |
+
lime: "0f0",
|
| 490 |
+
limegreen: "32cd32",
|
| 491 |
+
linen: "faf0e6",
|
| 492 |
+
magenta: "f0f",
|
| 493 |
+
maroon: "800000",
|
| 494 |
+
mediumaquamarine: "66cdaa",
|
| 495 |
+
mediumblue: "0000cd",
|
| 496 |
+
mediumorchid: "ba55d3",
|
| 497 |
+
mediumpurple: "9370db",
|
| 498 |
+
mediumseagreen: "3cb371",
|
| 499 |
+
mediumslateblue: "7b68ee",
|
| 500 |
+
mediumspringgreen: "00fa9a",
|
| 501 |
+
mediumturquoise: "48d1cc",
|
| 502 |
+
mediumvioletred: "c71585",
|
| 503 |
+
midnightblue: "191970",
|
| 504 |
+
mintcream: "f5fffa",
|
| 505 |
+
mistyrose: "ffe4e1",
|
| 506 |
+
moccasin: "ffe4b5",
|
| 507 |
+
navajowhite: "ffdead",
|
| 508 |
+
navy: "000080",
|
| 509 |
+
oldlace: "fdf5e6",
|
| 510 |
+
olive: "808000",
|
| 511 |
+
olivedrab: "6b8e23",
|
| 512 |
+
orange: "ffa500",
|
| 513 |
+
orangered: "ff4500",
|
| 514 |
+
orchid: "da70d6",
|
| 515 |
+
palegoldenrod: "eee8aa",
|
| 516 |
+
palegreen: "98fb98",
|
| 517 |
+
paleturquoise: "afeeee",
|
| 518 |
+
palevioletred: "db7093",
|
| 519 |
+
papayawhip: "ffefd5",
|
| 520 |
+
peachpuff: "ffdab9",
|
| 521 |
+
peru: "cd853f",
|
| 522 |
+
pink: "ffc0cb",
|
| 523 |
+
plum: "dda0dd",
|
| 524 |
+
powderblue: "b0e0e6",
|
| 525 |
+
purple: "800080",
|
| 526 |
+
rebeccapurple: "639",
|
| 527 |
+
red: "f00",
|
| 528 |
+
rosybrown: "bc8f8f",
|
| 529 |
+
royalblue: "4169e1",
|
| 530 |
+
saddlebrown: "8b4513",
|
| 531 |
+
salmon: "fa8072",
|
| 532 |
+
sandybrown: "f4a460",
|
| 533 |
+
seagreen: "2e8b57",
|
| 534 |
+
seashell: "fff5ee",
|
| 535 |
+
sienna: "a0522d",
|
| 536 |
+
silver: "c0c0c0",
|
| 537 |
+
skyblue: "87ceeb",
|
| 538 |
+
slateblue: "6a5acd",
|
| 539 |
+
slategray: "708090",
|
| 540 |
+
slategrey: "708090",
|
| 541 |
+
snow: "fffafa",
|
| 542 |
+
springgreen: "00ff7f",
|
| 543 |
+
steelblue: "4682b4",
|
| 544 |
+
tan: "d2b48c",
|
| 545 |
+
teal: "008080",
|
| 546 |
+
thistle: "d8bfd8",
|
| 547 |
+
tomato: "ff6347",
|
| 548 |
+
turquoise: "40e0d0",
|
| 549 |
+
violet: "ee82ee",
|
| 550 |
+
wheat: "f5deb3",
|
| 551 |
+
white: "fff",
|
| 552 |
+
whitesmoke: "f5f5f5",
|
| 553 |
+
yellow: "ff0",
|
| 554 |
+
yellowgreen: "9acd32"
|
| 555 |
+
};
|
| 556 |
+
function nameToHex(color) {
|
| 557 |
+
if (typeof color != "string") return color;
|
| 558 |
+
var normalizedColorName = color.toLowerCase();
|
| 559 |
+
return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color;
|
| 560 |
+
}
|
| 561 |
+
var hexRegex = /^#[a-fA-F0-9]{6}$/, hexRgbaRegex = /^#[a-fA-F0-9]{8}$/, reducedHexRegex = /^#[a-fA-F0-9]{3}$/, reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/, rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i, rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i, hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i, hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
| 562 |
+
function parseToRgb(color) {
|
| 563 |
+
if (typeof color != "string")
|
| 564 |
+
throw new PolishedError(3);
|
| 565 |
+
var normalizedColor = nameToHex(color);
|
| 566 |
+
if (normalizedColor.match(hexRegex))
|
| 567 |
+
return {
|
| 568 |
+
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
| 569 |
+
green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
|
| 570 |
+
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
|
| 571 |
+
};
|
| 572 |
+
if (normalizedColor.match(hexRgbaRegex)) {
|
| 573 |
+
var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
|
| 574 |
+
return {
|
| 575 |
+
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
| 576 |
+
green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
|
| 577 |
+
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
|
| 578 |
+
alpha
|
| 579 |
+
};
|
| 580 |
+
}
|
| 581 |
+
if (normalizedColor.match(reducedHexRegex))
|
| 582 |
+
return {
|
| 583 |
+
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
| 584 |
+
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
| 585 |
+
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
|
| 586 |
+
};
|
| 587 |
+
if (normalizedColor.match(reducedRgbaHexRegex)) {
|
| 588 |
+
var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
|
| 589 |
+
return {
|
| 590 |
+
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
| 591 |
+
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
| 592 |
+
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
|
| 593 |
+
alpha: _alpha
|
| 594 |
+
};
|
| 595 |
+
}
|
| 596 |
+
var rgbMatched = rgbRegex.exec(normalizedColor);
|
| 597 |
+
if (rgbMatched)
|
| 598 |
+
return {
|
| 599 |
+
red: parseInt("" + rgbMatched[1], 10),
|
| 600 |
+
green: parseInt("" + rgbMatched[2], 10),
|
| 601 |
+
blue: parseInt("" + rgbMatched[3], 10)
|
| 602 |
+
};
|
| 603 |
+
var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
|
| 604 |
+
if (rgbaMatched)
|
| 605 |
+
return {
|
| 606 |
+
red: parseInt("" + rgbaMatched[1], 10),
|
| 607 |
+
green: parseInt("" + rgbaMatched[2], 10),
|
| 608 |
+
blue: parseInt("" + rgbaMatched[3], 10),
|
| 609 |
+
alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
|
| 610 |
+
};
|
| 611 |
+
var hslMatched = hslRegex.exec(normalizedColor);
|
| 612 |
+
if (hslMatched) {
|
| 613 |
+
var hue = parseInt("" + hslMatched[1], 10), saturation = parseInt("" + hslMatched[2], 10) / 100, lightness = parseInt("" + hslMatched[3], 10) / 100, rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")", hslRgbMatched = rgbRegex.exec(rgbColorString);
|
| 614 |
+
if (!hslRgbMatched)
|
| 615 |
+
throw new PolishedError(4, normalizedColor, rgbColorString);
|
| 616 |
+
return {
|
| 617 |
+
red: parseInt("" + hslRgbMatched[1], 10),
|
| 618 |
+
green: parseInt("" + hslRgbMatched[2], 10),
|
| 619 |
+
blue: parseInt("" + hslRgbMatched[3], 10)
|
| 620 |
+
};
|
| 621 |
+
}
|
| 622 |
+
var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
|
| 623 |
+
if (hslaMatched) {
|
| 624 |
+
var _hue = parseInt("" + hslaMatched[1], 10), _saturation = parseInt("" + hslaMatched[2], 10) / 100, _lightness = parseInt("" + hslaMatched[3], 10) / 100, _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")", _hslRgbMatched = rgbRegex.exec(_rgbColorString);
|
| 625 |
+
if (!_hslRgbMatched)
|
| 626 |
+
throw new PolishedError(4, normalizedColor, _rgbColorString);
|
| 627 |
+
return {
|
| 628 |
+
red: parseInt("" + _hslRgbMatched[1], 10),
|
| 629 |
+
green: parseInt("" + _hslRgbMatched[2], 10),
|
| 630 |
+
blue: parseInt("" + _hslRgbMatched[3], 10),
|
| 631 |
+
alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
|
| 632 |
+
};
|
| 633 |
+
}
|
| 634 |
+
throw new PolishedError(5);
|
| 635 |
+
}
|
| 636 |
+
function rgbToHsl(color) {
|
| 637 |
+
var red = color.red / 255, green = color.green / 255, blue = color.blue / 255, max = Math.max(red, green, blue), min = Math.min(red, green, blue), lightness = (max + min) / 2;
|
| 638 |
+
if (max === min)
|
| 639 |
+
return color.alpha !== void 0 ? {
|
| 640 |
+
hue: 0,
|
| 641 |
+
saturation: 0,
|
| 642 |
+
lightness,
|
| 643 |
+
alpha: color.alpha
|
| 644 |
+
} : {
|
| 645 |
+
hue: 0,
|
| 646 |
+
saturation: 0,
|
| 647 |
+
lightness
|
| 648 |
+
};
|
| 649 |
+
var hue, delta = max - min, saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
| 650 |
+
switch (max) {
|
| 651 |
+
case red:
|
| 652 |
+
hue = (green - blue) / delta + (green < blue ? 6 : 0);
|
| 653 |
+
break;
|
| 654 |
+
case green:
|
| 655 |
+
hue = (blue - red) / delta + 2;
|
| 656 |
+
break;
|
| 657 |
+
default:
|
| 658 |
+
hue = (red - green) / delta + 4;
|
| 659 |
+
break;
|
| 660 |
+
}
|
| 661 |
+
return hue *= 60, color.alpha !== void 0 ? {
|
| 662 |
+
hue,
|
| 663 |
+
saturation,
|
| 664 |
+
lightness,
|
| 665 |
+
alpha: color.alpha
|
| 666 |
+
} : {
|
| 667 |
+
hue,
|
| 668 |
+
saturation,
|
| 669 |
+
lightness
|
| 670 |
+
};
|
| 671 |
+
}
|
| 672 |
+
function parseToHsl(color) {
|
| 673 |
+
return rgbToHsl(parseToRgb(color));
|
| 674 |
+
}
|
| 675 |
+
var reduceHexValue = function(value) {
|
| 676 |
+
return value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6] ? "#" + value[1] + value[3] + value[5] : value;
|
| 677 |
+
}, reduceHexValue$1 = reduceHexValue;
|
| 678 |
+
function numberToHex(value) {
|
| 679 |
+
var hex = value.toString(16);
|
| 680 |
+
return hex.length === 1 ? "0" + hex : hex;
|
| 681 |
+
}
|
| 682 |
+
function colorToHex(color) {
|
| 683 |
+
return numberToHex(Math.round(color * 255));
|
| 684 |
+
}
|
| 685 |
+
function convertToHex(red, green, blue) {
|
| 686 |
+
return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
|
| 687 |
+
}
|
| 688 |
+
function hslToHex(hue, saturation, lightness) {
|
| 689 |
+
return hslToRgb(hue, saturation, lightness, convertToHex);
|
| 690 |
+
}
|
| 691 |
+
function hsl(value, saturation, lightness) {
|
| 692 |
+
if (typeof value == "number" && typeof saturation == "number" && typeof lightness == "number")
|
| 693 |
+
return hslToHex(value, saturation, lightness);
|
| 694 |
+
if (typeof value == "object" && saturation === void 0 && lightness === void 0)
|
| 695 |
+
return hslToHex(value.hue, value.saturation, value.lightness);
|
| 696 |
+
throw new PolishedError(1);
|
| 697 |
+
}
|
| 698 |
+
function hsla(value, saturation, lightness, alpha) {
|
| 699 |
+
if (typeof value == "number" && typeof saturation == "number" && typeof lightness == "number" && typeof alpha == "number")
|
| 700 |
+
return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
|
| 701 |
+
if (typeof value == "object" && saturation === void 0 && lightness === void 0 && alpha === void 0)
|
| 702 |
+
return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
|
| 703 |
+
throw new PolishedError(2);
|
| 704 |
+
}
|
| 705 |
+
function rgb(value, green, blue) {
|
| 706 |
+
if (typeof value == "number" && typeof green == "number" && typeof blue == "number")
|
| 707 |
+
return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
|
| 708 |
+
if (typeof value == "object" && green === void 0 && blue === void 0)
|
| 709 |
+
return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
|
| 710 |
+
throw new PolishedError(6);
|
| 711 |
+
}
|
| 712 |
+
function rgba(firstValue, secondValue, thirdValue, fourthValue) {
|
| 713 |
+
if (typeof firstValue == "string" && typeof secondValue == "number") {
|
| 714 |
+
var rgbValue = parseToRgb(firstValue);
|
| 715 |
+
return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
|
| 716 |
+
} else {
|
| 717 |
+
if (typeof firstValue == "number" && typeof secondValue == "number" && typeof thirdValue == "number" && typeof fourthValue == "number")
|
| 718 |
+
return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
|
| 719 |
+
if (typeof firstValue == "object" && secondValue === void 0 && thirdValue === void 0 && fourthValue === void 0)
|
| 720 |
+
return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
|
| 721 |
+
}
|
| 722 |
+
throw new PolishedError(7);
|
| 723 |
+
}
|
| 724 |
+
var isRgb = function(color) {
|
| 725 |
+
return typeof color.red == "number" && typeof color.green == "number" && typeof color.blue == "number" && (typeof color.alpha != "number" || typeof color.alpha > "u");
|
| 726 |
+
}, isRgba = function(color) {
|
| 727 |
+
return typeof color.red == "number" && typeof color.green == "number" && typeof color.blue == "number" && typeof color.alpha == "number";
|
| 728 |
+
}, isHsl = function(color) {
|
| 729 |
+
return typeof color.hue == "number" && typeof color.saturation == "number" && typeof color.lightness == "number" && (typeof color.alpha != "number" || typeof color.alpha > "u");
|
| 730 |
+
}, isHsla = function(color) {
|
| 731 |
+
return typeof color.hue == "number" && typeof color.saturation == "number" && typeof color.lightness == "number" && typeof color.alpha == "number";
|
| 732 |
+
};
|
| 733 |
+
function toColorString(color) {
|
| 734 |
+
if (typeof color != "object") throw new PolishedError(8);
|
| 735 |
+
if (isRgba(color)) return rgba(color);
|
| 736 |
+
if (isRgb(color)) return rgb(color);
|
| 737 |
+
if (isHsla(color)) return hsla(color);
|
| 738 |
+
if (isHsl(color)) return hsl(color);
|
| 739 |
+
throw new PolishedError(8);
|
| 740 |
+
}
|
| 741 |
+
function curried(f, length, acc) {
|
| 742 |
+
return function() {
|
| 743 |
+
var combined = acc.concat(Array.prototype.slice.call(arguments));
|
| 744 |
+
return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
|
| 745 |
+
};
|
| 746 |
+
}
|
| 747 |
+
function curry(f) {
|
| 748 |
+
return curried(f, f.length, []);
|
| 749 |
+
}
|
| 750 |
+
function adjustHue(degree, color) {
|
| 751 |
+
if (color === "transparent") return color;
|
| 752 |
+
var hslColor = parseToHsl(color);
|
| 753 |
+
return toColorString(_extends({}, hslColor, {
|
| 754 |
+
hue: hslColor.hue + parseFloat(degree)
|
| 755 |
+
}));
|
| 756 |
+
}
|
| 757 |
+
var curriedAdjustHue = curry(adjustHue);
|
| 758 |
+
function guard(lowerBoundary, upperBoundary, value) {
|
| 759 |
+
return Math.max(lowerBoundary, Math.min(upperBoundary, value));
|
| 760 |
+
}
|
| 761 |
+
function darken(amount, color) {
|
| 762 |
+
if (color === "transparent") return color;
|
| 763 |
+
var hslColor = parseToHsl(color);
|
| 764 |
+
return toColorString(_extends({}, hslColor, {
|
| 765 |
+
lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
|
| 766 |
+
}));
|
| 767 |
+
}
|
| 768 |
+
var curriedDarken = curry(darken), curriedDarken$1 = curriedDarken;
|
| 769 |
+
function desaturate(amount, color) {
|
| 770 |
+
if (color === "transparent") return color;
|
| 771 |
+
var hslColor = parseToHsl(color);
|
| 772 |
+
return toColorString(_extends({}, hslColor, {
|
| 773 |
+
saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
|
| 774 |
+
}));
|
| 775 |
+
}
|
| 776 |
+
var curriedDesaturate = curry(desaturate);
|
| 777 |
+
function lighten(amount, color) {
|
| 778 |
+
if (color === "transparent") return color;
|
| 779 |
+
var hslColor = parseToHsl(color);
|
| 780 |
+
return toColorString(_extends({}, hslColor, {
|
| 781 |
+
lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
|
| 782 |
+
}));
|
| 783 |
+
}
|
| 784 |
+
var curriedLighten = curry(lighten), curriedLighten$1 = curriedLighten;
|
| 785 |
+
function mix(weight, color, otherColor) {
|
| 786 |
+
if (color === "transparent") return otherColor;
|
| 787 |
+
if (otherColor === "transparent") return color;
|
| 788 |
+
if (weight === 0) return otherColor;
|
| 789 |
+
var parsedColor1 = parseToRgb(color), color1 = _extends({}, parsedColor1, {
|
| 790 |
+
alpha: typeof parsedColor1.alpha == "number" ? parsedColor1.alpha : 1
|
| 791 |
+
}), parsedColor2 = parseToRgb(otherColor), color2 = _extends({}, parsedColor2, {
|
| 792 |
+
alpha: typeof parsedColor2.alpha == "number" ? parsedColor2.alpha : 1
|
| 793 |
+
}), alphaDelta = color1.alpha - color2.alpha, x = parseFloat(weight) * 2 - 1, y = x * alphaDelta === -1 ? x : x + alphaDelta, z = 1 + x * alphaDelta, weight1 = (y / z + 1) / 2, weight2 = 1 - weight1, mixedColor = {
|
| 794 |
+
red: Math.floor(color1.red * weight1 + color2.red * weight2),
|
| 795 |
+
green: Math.floor(color1.green * weight1 + color2.green * weight2),
|
| 796 |
+
blue: Math.floor(color1.blue * weight1 + color2.blue * weight2),
|
| 797 |
+
alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight))
|
| 798 |
+
};
|
| 799 |
+
return rgba(mixedColor);
|
| 800 |
+
}
|
| 801 |
+
var curriedMix = curry(mix), mix$1 = curriedMix;
|
| 802 |
+
function opacify(amount, color) {
|
| 803 |
+
if (color === "transparent") return color;
|
| 804 |
+
var parsedColor = parseToRgb(color), alpha = typeof parsedColor.alpha == "number" ? parsedColor.alpha : 1, colorWithAlpha = _extends({}, parsedColor, {
|
| 805 |
+
alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
|
| 806 |
+
});
|
| 807 |
+
return rgba(colorWithAlpha);
|
| 808 |
+
}
|
| 809 |
+
var curriedOpacify = curry(opacify), curriedOpacify$1 = curriedOpacify;
|
| 810 |
+
function saturate(amount, color) {
|
| 811 |
+
if (color === "transparent") return color;
|
| 812 |
+
var hslColor = parseToHsl(color);
|
| 813 |
+
return toColorString(_extends({}, hslColor, {
|
| 814 |
+
saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
|
| 815 |
+
}));
|
| 816 |
+
}
|
| 817 |
+
var curriedSaturate = curry(saturate);
|
| 818 |
+
function setHue(hue, color) {
|
| 819 |
+
return color === "transparent" ? color : toColorString(_extends({}, parseToHsl(color), {
|
| 820 |
+
hue: parseFloat(hue)
|
| 821 |
+
}));
|
| 822 |
+
}
|
| 823 |
+
var curriedSetHue = curry(setHue);
|
| 824 |
+
function setLightness(lightness, color) {
|
| 825 |
+
return color === "transparent" ? color : toColorString(_extends({}, parseToHsl(color), {
|
| 826 |
+
lightness: parseFloat(lightness)
|
| 827 |
+
}));
|
| 828 |
+
}
|
| 829 |
+
var curriedSetLightness = curry(setLightness);
|
| 830 |
+
function setSaturation(saturation, color) {
|
| 831 |
+
return color === "transparent" ? color : toColorString(_extends({}, parseToHsl(color), {
|
| 832 |
+
saturation: parseFloat(saturation)
|
| 833 |
+
}));
|
| 834 |
+
}
|
| 835 |
+
var curriedSetSaturation = curry(setSaturation);
|
| 836 |
+
function shade(percentage, color) {
|
| 837 |
+
return color === "transparent" ? color : mix$1(parseFloat(percentage), "rgb(0, 0, 0)", color);
|
| 838 |
+
}
|
| 839 |
+
var curriedShade = curry(shade);
|
| 840 |
+
function tint(percentage, color) {
|
| 841 |
+
return color === "transparent" ? color : mix$1(parseFloat(percentage), "rgb(255, 255, 255)", color);
|
| 842 |
+
}
|
| 843 |
+
var curriedTint = curry(tint);
|
| 844 |
+
function transparentize(amount, color) {
|
| 845 |
+
if (color === "transparent") return color;
|
| 846 |
+
var parsedColor = parseToRgb(color), alpha = typeof parsedColor.alpha == "number" ? parsedColor.alpha : 1, colorWithAlpha = _extends({}, parsedColor, {
|
| 847 |
+
alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
|
| 848 |
+
});
|
| 849 |
+
return rgba(colorWithAlpha);
|
| 850 |
+
}
|
| 851 |
+
var curriedTransparentize = curry(transparentize), curriedTransparentize$1 = curriedTransparentize;
|
| 852 |
+
|
| 853 |
+
// src/blocks/components/EmptyBlock.tsx
|
| 854 |
+
import { styled } from "storybook/theming";
|
| 855 |
+
var Wrapper = styled.div(withReset, ({ theme }) => ({
|
| 856 |
+
backgroundColor: theme.base === "light" ? "rgba(0,0,0,.01)" : "rgba(255,255,255,.01)",
|
| 857 |
+
borderRadius: theme.appBorderRadius,
|
| 858 |
+
border: `1px dashed ${theme.appBorderColor}`,
|
| 859 |
+
display: "flex",
|
| 860 |
+
alignItems: "center",
|
| 861 |
+
justifyContent: "center",
|
| 862 |
+
padding: 20,
|
| 863 |
+
margin: "25px 0 40px",
|
| 864 |
+
color: curriedTransparentize$1(0.3, theme.color.defaultText),
|
| 865 |
+
fontSize: theme.typography.size.s2
|
| 866 |
+
})), EmptyBlock = (props) => React.createElement(Wrapper, { ...props, className: "docblock-emptyblock sb-unstyled" });
|
| 867 |
+
|
| 868 |
+
// src/blocks/components/Source.tsx
|
| 869 |
+
var StyledSyntaxHighlighter = styled2(
|
| 870 |
+
SyntaxHighlighter
|
| 871 |
+
)(({ theme }) => ({
|
| 872 |
+
// DocBlocks-specific styling and overrides
|
| 873 |
+
fontSize: `${theme.typography.size.s2 - 1}px`,
|
| 874 |
+
lineHeight: "19px",
|
| 875 |
+
margin: "25px 0 40px",
|
| 876 |
+
borderRadius: theme.appBorderRadius,
|
| 877 |
+
boxShadow: theme.base === "light" ? "rgba(0, 0, 0, 0.10) 0 1px 3px 0" : "rgba(0, 0, 0, 0.20) 0 2px 5px 0",
|
| 878 |
+
"pre.prismjs": {
|
| 879 |
+
padding: 20,
|
| 880 |
+
background: "inherit"
|
| 881 |
+
}
|
| 882 |
+
}));
|
| 883 |
+
var SourceSkeletonWrapper = styled2.div(({ theme }) => ({
|
| 884 |
+
background: theme.background.content,
|
| 885 |
+
borderRadius: theme.appBorderRadius,
|
| 886 |
+
border: `1px solid ${theme.appBorderColor}`,
|
| 887 |
+
boxShadow: theme.base === "light" ? "rgba(0, 0, 0, 0.10) 0 1px 3px 0" : "rgba(0, 0, 0, 0.20) 0 2px 5px 0",
|
| 888 |
+
margin: "25px 0 40px",
|
| 889 |
+
padding: "20px 20px 20px 22px"
|
| 890 |
+
})), SourceSkeletonPlaceholder = styled2.div(({ theme }) => ({
|
| 891 |
+
animation: `${theme.animation.glow} 1.5s ease-in-out infinite`,
|
| 892 |
+
background: theme.appBorderColor,
|
| 893 |
+
height: 17,
|
| 894 |
+
marginTop: 1,
|
| 895 |
+
width: "60%",
|
| 896 |
+
[`&:first-child${ignoreSsrWarning}`]: {
|
| 897 |
+
margin: 0
|
| 898 |
+
}
|
| 899 |
+
})), SourceSkeleton = () => React2.createElement(SourceSkeletonWrapper, null, React2.createElement(SourceSkeletonPlaceholder, null), React2.createElement(SourceSkeletonPlaceholder, { style: { width: "80%" } }), React2.createElement(SourceSkeletonPlaceholder, { style: { width: "30%" } }), React2.createElement(SourceSkeletonPlaceholder, { style: { width: "80%" } })), Source = ({
|
| 900 |
+
isLoading,
|
| 901 |
+
error,
|
| 902 |
+
language,
|
| 903 |
+
code,
|
| 904 |
+
dark,
|
| 905 |
+
format: format2 = !0,
|
| 906 |
+
...rest
|
| 907 |
+
}) => {
|
| 908 |
+
let { typography } = useTheme();
|
| 909 |
+
if (isLoading)
|
| 910 |
+
return React2.createElement(SourceSkeleton, null);
|
| 911 |
+
if (error)
|
| 912 |
+
return React2.createElement(EmptyBlock, null, error);
|
| 913 |
+
let syntaxHighlighter = React2.createElement(
|
| 914 |
+
StyledSyntaxHighlighter,
|
| 915 |
+
{
|
| 916 |
+
bordered: !0,
|
| 917 |
+
copyable: !0,
|
| 918 |
+
format: format2,
|
| 919 |
+
language: language ?? "jsx",
|
| 920 |
+
className: "docblock-source sb-unstyled",
|
| 921 |
+
...rest
|
| 922 |
+
},
|
| 923 |
+
code
|
| 924 |
+
);
|
| 925 |
+
if (typeof dark > "u")
|
| 926 |
+
return syntaxHighlighter;
|
| 927 |
+
let overrideTheme = dark ? themes.dark : themes.light;
|
| 928 |
+
return React2.createElement(
|
| 929 |
+
ThemeProvider,
|
| 930 |
+
{
|
| 931 |
+
theme: convert({
|
| 932 |
+
...overrideTheme,
|
| 933 |
+
fontCode: typography.fonts.mono,
|
| 934 |
+
fontBase: typography.fonts.base
|
| 935 |
+
})
|
| 936 |
+
},
|
| 937 |
+
syntaxHighlighter
|
| 938 |
+
);
|
| 939 |
+
};
|
| 940 |
+
|
| 941 |
+
export {
|
| 942 |
+
rgba,
|
| 943 |
+
curriedDarken$1,
|
| 944 |
+
curriedLighten$1,
|
| 945 |
+
curriedOpacify$1,
|
| 946 |
+
curriedTransparentize$1,
|
| 947 |
+
EmptyBlock,
|
| 948 |
+
Source
|
| 949 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/chunk-CYSK6WYR.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// src/blocks/controls/helpers.ts
|
| 2 |
+
var getControlId = (value) => `control-${value.replace(/\s+/g, "-")}`, getControlSetterButtonId = (value) => `set-${value.replace(/\s+/g, "-")}`;
|
| 3 |
+
|
| 4 |
+
export {
|
| 5 |
+
getControlId,
|
| 6 |
+
getControlSetterButtonId
|
| 7 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/chunk-OATZR77O.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// src/DocsRenderer.tsx
|
| 2 |
+
import React, { Component } from "react";
|
| 3 |
+
import { renderElement, unmountElement } from "@storybook/react-dom-shim";
|
| 4 |
+
import { AnchorMdx, CodeOrSourceMdx, Docs, HeadersMdx } from "@storybook/addon-docs/blocks";
|
| 5 |
+
var defaultComponents = {
|
| 6 |
+
code: CodeOrSourceMdx,
|
| 7 |
+
a: AnchorMdx,
|
| 8 |
+
...HeadersMdx
|
| 9 |
+
}, ErrorBoundary = class extends Component {
|
| 10 |
+
constructor() {
|
| 11 |
+
super(...arguments);
|
| 12 |
+
this.state = { hasError: !1 };
|
| 13 |
+
}
|
| 14 |
+
static getDerivedStateFromError() {
|
| 15 |
+
return { hasError: !0 };
|
| 16 |
+
}
|
| 17 |
+
componentDidCatch(err) {
|
| 18 |
+
let { showException } = this.props;
|
| 19 |
+
showException(err);
|
| 20 |
+
}
|
| 21 |
+
render() {
|
| 22 |
+
let { hasError } = this.state, { children } = this.props;
|
| 23 |
+
return hasError ? null : React.createElement(React.Fragment, null, children);
|
| 24 |
+
}
|
| 25 |
+
}, DocsRenderer = class {
|
| 26 |
+
constructor() {
|
| 27 |
+
this.render = async (context, docsParameter, element) => {
|
| 28 |
+
let components = {
|
| 29 |
+
...defaultComponents,
|
| 30 |
+
...docsParameter?.components
|
| 31 |
+
}, TDocs = Docs;
|
| 32 |
+
return new Promise((resolve, reject) => {
|
| 33 |
+
import("@mdx-js/react").then(
|
| 34 |
+
({ MDXProvider }) => (
|
| 35 |
+
// We use a `key={}` here to reset the `hasError` state each time we render ErrorBoundary
|
| 36 |
+
renderElement(
|
| 37 |
+
React.createElement(ErrorBoundary, { showException: reject, key: Math.random() }, React.createElement(MDXProvider, { components }, React.createElement(TDocs, { context, docsParameter }))),
|
| 38 |
+
element
|
| 39 |
+
)
|
| 40 |
+
)
|
| 41 |
+
).then(() => resolve());
|
| 42 |
+
});
|
| 43 |
+
}, this.unmount = (element) => {
|
| 44 |
+
unmountElement(element);
|
| 45 |
+
};
|
| 46 |
+
}
|
| 47 |
+
};
|
| 48 |
+
|
| 49 |
+
export {
|
| 50 |
+
defaultComponents,
|
| 51 |
+
DocsRenderer
|
| 52 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/chunk-S4QKU6I5.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import {
|
| 2 |
+
__export
|
| 3 |
+
} from "./chunk-SL3VIQZ3.js";
|
| 4 |
+
|
| 5 |
+
// src/preview.ts
|
| 6 |
+
var preview_exports = {};
|
| 7 |
+
__export(preview_exports, {
|
| 8 |
+
parameters: () => parameters
|
| 9 |
+
});
|
| 10 |
+
var excludeTags = Object.entries(globalThis.TAGS_OPTIONS ?? {}).reduce(
|
| 11 |
+
(acc, entry) => {
|
| 12 |
+
let [tag, option] = entry;
|
| 13 |
+
return option.excludeFromDocsStories && (acc[tag] = !0), acc;
|
| 14 |
+
},
|
| 15 |
+
{}
|
| 16 |
+
), parameters = {
|
| 17 |
+
docs: {
|
| 18 |
+
renderer: async () => {
|
| 19 |
+
let { DocsRenderer } = await import("./DocsRenderer-LL677BLK.js");
|
| 20 |
+
return new DocsRenderer();
|
| 21 |
+
},
|
| 22 |
+
stories: {
|
| 23 |
+
filter: (story) => (story.tags || []).filter((tag) => excludeTags[tag]).length === 0 && !story.parameters.docs?.disable
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
export {
|
| 29 |
+
parameters,
|
| 30 |
+
preview_exports
|
| 31 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_browser-chunks/chunk-SL3VIQZ3.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
var __create = Object.create;
|
| 2 |
+
var __defProp = Object.defineProperty;
|
| 3 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 4 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 5 |
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 6 |
+
var __commonJS = (cb, mod) => function() {
|
| 7 |
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
| 8 |
+
};
|
| 9 |
+
var __export = (target, all) => {
|
| 10 |
+
for (var name in all)
|
| 11 |
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
| 12 |
+
}, __copyProps = (to, from, except, desc) => {
|
| 13 |
+
if (from && typeof from == "object" || typeof from == "function")
|
| 14 |
+
for (let key of __getOwnPropNames(from))
|
| 15 |
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 16 |
+
return to;
|
| 17 |
+
};
|
| 18 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 19 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 20 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 21 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 22 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 23 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
| 24 |
+
mod
|
| 25 |
+
));
|
| 26 |
+
|
| 27 |
+
export {
|
| 28 |
+
__commonJS,
|
| 29 |
+
__export,
|
| 30 |
+
__toESM
|
| 31 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/chunk-2SCGLXP5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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import CJS_COMPAT_NODE_URL_t17piavj1z from 'node:url';
|
| 2 |
+
import CJS_COMPAT_NODE_PATH_t17piavj1z from 'node:path';
|
| 3 |
+
import CJS_COMPAT_NODE_MODULE_t17piavj1z from "node:module";
|
| 4 |
+
|
| 5 |
+
var __filename = CJS_COMPAT_NODE_URL_t17piavj1z.fileURLToPath(import.meta.url);
|
| 6 |
+
var __dirname = CJS_COMPAT_NODE_PATH_t17piavj1z.dirname(__filename);
|
| 7 |
+
var require = CJS_COMPAT_NODE_MODULE_t17piavj1z.createRequire(import.meta.url);
|
| 8 |
+
|
| 9 |
+
// ------------------------------------------------------------
|
| 10 |
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
| 11 |
+
// ------------------------------------------------------------
|
| 12 |
+
|
| 13 |
+
// ../../../node_modules/@ungap/structured-clone/esm/deserialize.js
|
| 14 |
+
var env = typeof self == "object" ? self : globalThis, deserializer = ($, _) => {
|
| 15 |
+
let as = (out, index) => ($.set(index, out), out), unpair = (index) => {
|
| 16 |
+
if ($.has(index))
|
| 17 |
+
return $.get(index);
|
| 18 |
+
let [type, value] = _[index];
|
| 19 |
+
switch (type) {
|
| 20 |
+
case 0:
|
| 21 |
+
case -1:
|
| 22 |
+
return as(value, index);
|
| 23 |
+
case 1: {
|
| 24 |
+
let arr = as([], index);
|
| 25 |
+
for (let index2 of value)
|
| 26 |
+
arr.push(unpair(index2));
|
| 27 |
+
return arr;
|
| 28 |
+
}
|
| 29 |
+
case 2: {
|
| 30 |
+
let object = as({}, index);
|
| 31 |
+
for (let [key, index2] of value)
|
| 32 |
+
object[unpair(key)] = unpair(index2);
|
| 33 |
+
return object;
|
| 34 |
+
}
|
| 35 |
+
case 3:
|
| 36 |
+
return as(new Date(value), index);
|
| 37 |
+
case 4: {
|
| 38 |
+
let { source, flags } = value;
|
| 39 |
+
return as(new RegExp(source, flags), index);
|
| 40 |
+
}
|
| 41 |
+
case 5: {
|
| 42 |
+
let map = as(/* @__PURE__ */ new Map(), index);
|
| 43 |
+
for (let [key, index2] of value)
|
| 44 |
+
map.set(unpair(key), unpair(index2));
|
| 45 |
+
return map;
|
| 46 |
+
}
|
| 47 |
+
case 6: {
|
| 48 |
+
let set = as(/* @__PURE__ */ new Set(), index);
|
| 49 |
+
for (let index2 of value)
|
| 50 |
+
set.add(unpair(index2));
|
| 51 |
+
return set;
|
| 52 |
+
}
|
| 53 |
+
case 7: {
|
| 54 |
+
let { name, message } = value;
|
| 55 |
+
return as(new env[name](message), index);
|
| 56 |
+
}
|
| 57 |
+
case 8:
|
| 58 |
+
return as(BigInt(value), index);
|
| 59 |
+
case "BigInt":
|
| 60 |
+
return as(Object(BigInt(value)), index);
|
| 61 |
+
case "ArrayBuffer":
|
| 62 |
+
return as(new Uint8Array(value).buffer, value);
|
| 63 |
+
case "DataView": {
|
| 64 |
+
let { buffer } = new Uint8Array(value);
|
| 65 |
+
return as(new DataView(buffer), value);
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
return as(new env[type](value), index);
|
| 69 |
+
};
|
| 70 |
+
return unpair;
|
| 71 |
+
}, deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
|
| 72 |
+
|
| 73 |
+
// ../../../node_modules/@ungap/structured-clone/esm/serialize.js
|
| 74 |
+
var EMPTY = "", { toString } = {}, { keys } = Object, typeOf = (value) => {
|
| 75 |
+
let type = typeof value;
|
| 76 |
+
if (type !== "object" || !value)
|
| 77 |
+
return [0, type];
|
| 78 |
+
let asString = toString.call(value).slice(8, -1);
|
| 79 |
+
switch (asString) {
|
| 80 |
+
case "Array":
|
| 81 |
+
return [1, EMPTY];
|
| 82 |
+
case "Object":
|
| 83 |
+
return [2, EMPTY];
|
| 84 |
+
case "Date":
|
| 85 |
+
return [3, EMPTY];
|
| 86 |
+
case "RegExp":
|
| 87 |
+
return [4, EMPTY];
|
| 88 |
+
case "Map":
|
| 89 |
+
return [5, EMPTY];
|
| 90 |
+
case "Set":
|
| 91 |
+
return [6, EMPTY];
|
| 92 |
+
case "DataView":
|
| 93 |
+
return [1, asString];
|
| 94 |
+
}
|
| 95 |
+
return asString.includes("Array") ? [1, asString] : asString.includes("Error") ? [7, asString] : [2, asString];
|
| 96 |
+
}, shouldSkip = ([TYPE, type]) => TYPE === 0 && (type === "function" || type === "symbol"), serializer = (strict, json, $, _) => {
|
| 97 |
+
let as = (out, value) => {
|
| 98 |
+
let index = _.push(out) - 1;
|
| 99 |
+
return $.set(value, index), index;
|
| 100 |
+
}, pair = (value) => {
|
| 101 |
+
if ($.has(value))
|
| 102 |
+
return $.get(value);
|
| 103 |
+
let [TYPE, type] = typeOf(value);
|
| 104 |
+
switch (TYPE) {
|
| 105 |
+
case 0: {
|
| 106 |
+
let entry = value;
|
| 107 |
+
switch (type) {
|
| 108 |
+
case "bigint":
|
| 109 |
+
TYPE = 8, entry = value.toString();
|
| 110 |
+
break;
|
| 111 |
+
case "function":
|
| 112 |
+
case "symbol":
|
| 113 |
+
if (strict)
|
| 114 |
+
throw new TypeError("unable to serialize " + type);
|
| 115 |
+
entry = null;
|
| 116 |
+
break;
|
| 117 |
+
case "undefined":
|
| 118 |
+
return as([-1], value);
|
| 119 |
+
}
|
| 120 |
+
return as([TYPE, entry], value);
|
| 121 |
+
}
|
| 122 |
+
case 1: {
|
| 123 |
+
if (type) {
|
| 124 |
+
let spread = value;
|
| 125 |
+
return type === "DataView" ? spread = new Uint8Array(value.buffer) : type === "ArrayBuffer" && (spread = new Uint8Array(value)), as([type, [...spread]], value);
|
| 126 |
+
}
|
| 127 |
+
let arr = [], index = as([TYPE, arr], value);
|
| 128 |
+
for (let entry of value)
|
| 129 |
+
arr.push(pair(entry));
|
| 130 |
+
return index;
|
| 131 |
+
}
|
| 132 |
+
case 2: {
|
| 133 |
+
if (type)
|
| 134 |
+
switch (type) {
|
| 135 |
+
case "BigInt":
|
| 136 |
+
return as([type, value.toString()], value);
|
| 137 |
+
case "Boolean":
|
| 138 |
+
case "Number":
|
| 139 |
+
case "String":
|
| 140 |
+
return as([type, value.valueOf()], value);
|
| 141 |
+
}
|
| 142 |
+
if (json && "toJSON" in value)
|
| 143 |
+
return pair(value.toJSON());
|
| 144 |
+
let entries = [], index = as([TYPE, entries], value);
|
| 145 |
+
for (let key of keys(value))
|
| 146 |
+
(strict || !shouldSkip(typeOf(value[key]))) && entries.push([pair(key), pair(value[key])]);
|
| 147 |
+
return index;
|
| 148 |
+
}
|
| 149 |
+
case 3:
|
| 150 |
+
return as([TYPE, value.toISOString()], value);
|
| 151 |
+
case 4: {
|
| 152 |
+
let { source, flags } = value;
|
| 153 |
+
return as([TYPE, { source, flags }], value);
|
| 154 |
+
}
|
| 155 |
+
case 5: {
|
| 156 |
+
let entries = [], index = as([TYPE, entries], value);
|
| 157 |
+
for (let [key, entry] of value)
|
| 158 |
+
(strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry)))) && entries.push([pair(key), pair(entry)]);
|
| 159 |
+
return index;
|
| 160 |
+
}
|
| 161 |
+
case 6: {
|
| 162 |
+
let entries = [], index = as([TYPE, entries], value);
|
| 163 |
+
for (let entry of value)
|
| 164 |
+
(strict || !shouldSkip(typeOf(entry))) && entries.push(pair(entry));
|
| 165 |
+
return index;
|
| 166 |
+
}
|
| 167 |
+
}
|
| 168 |
+
let { message } = value;
|
| 169 |
+
return as([TYPE, { name: type, message }], value);
|
| 170 |
+
};
|
| 171 |
+
return pair;
|
| 172 |
+
}, serialize = (value, { json, lossy } = {}) => {
|
| 173 |
+
let _ = [];
|
| 174 |
+
return serializer(!(json || lossy), !!json, /* @__PURE__ */ new Map(), _)(value), _;
|
| 175 |
+
};
|
| 176 |
+
|
| 177 |
+
// ../../../node_modules/@ungap/structured-clone/esm/index.js
|
| 178 |
+
var esm_default = typeof structuredClone == "function" ? (
|
| 179 |
+
/* c8 ignore start */
|
| 180 |
+
(any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize(any, options)) : structuredClone(any)
|
| 181 |
+
) : (any, options) => deserialize(serialize(any, options));
|
| 182 |
+
|
| 183 |
+
// ../../../node_modules/space-separated-tokens/index.js
|
| 184 |
+
function parse(value) {
|
| 185 |
+
let input = String(value || "").trim();
|
| 186 |
+
return input ? input.split(/[ \t\n\r\f]+/g) : [];
|
| 187 |
+
}
|
| 188 |
+
function stringify(values) {
|
| 189 |
+
return values.join(" ").trim();
|
| 190 |
+
}
|
| 191 |
+
|
| 192 |
+
export {
|
| 193 |
+
esm_default,
|
| 194 |
+
parse,
|
| 195 |
+
stringify
|
| 196 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/chunk-4WYSRR6Q.js
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import CJS_COMPAT_NODE_URL_t17piavj1z from 'node:url';
|
| 2 |
+
import CJS_COMPAT_NODE_PATH_t17piavj1z from 'node:path';
|
| 3 |
+
import CJS_COMPAT_NODE_MODULE_t17piavj1z from "node:module";
|
| 4 |
+
|
| 5 |
+
var __filename = CJS_COMPAT_NODE_URL_t17piavj1z.fileURLToPath(import.meta.url);
|
| 6 |
+
var __dirname = CJS_COMPAT_NODE_PATH_t17piavj1z.dirname(__filename);
|
| 7 |
+
var require = CJS_COMPAT_NODE_MODULE_t17piavj1z.createRequire(import.meta.url);
|
| 8 |
+
|
| 9 |
+
// ------------------------------------------------------------
|
| 10 |
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
| 11 |
+
// ------------------------------------------------------------
|
| 12 |
+
|
| 13 |
+
// ../../../node_modules/unist-util-is/lib/index.js
|
| 14 |
+
var convert = (
|
| 15 |
+
// Note: overloads in JSDoc can’t yet use different `@template`s.
|
| 16 |
+
/**
|
| 17 |
+
* @type {(
|
| 18 |
+
* (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
|
| 19 |
+
* (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
|
| 20 |
+
* (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
|
| 21 |
+
* ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
|
| 22 |
+
* ((test?: Test) => Check)
|
| 23 |
+
* )}
|
| 24 |
+
*/
|
| 25 |
+
/**
|
| 26 |
+
* @param {Test} [test]
|
| 27 |
+
* @returns {Check}
|
| 28 |
+
*/
|
| 29 |
+
(function(test) {
|
| 30 |
+
if (test == null)
|
| 31 |
+
return ok;
|
| 32 |
+
if (typeof test == "function")
|
| 33 |
+
return castFactory(test);
|
| 34 |
+
if (typeof test == "object")
|
| 35 |
+
return Array.isArray(test) ? anyFactory(test) : (
|
| 36 |
+
// Cast because `ReadonlyArray` goes into the above but `isArray`
|
| 37 |
+
// narrows to `Array`.
|
| 38 |
+
propertiesFactory(
|
| 39 |
+
/** @type {Props} */
|
| 40 |
+
test
|
| 41 |
+
)
|
| 42 |
+
);
|
| 43 |
+
if (typeof test == "string")
|
| 44 |
+
return typeFactory(test);
|
| 45 |
+
throw new Error("Expected function, string, or object as test");
|
| 46 |
+
})
|
| 47 |
+
);
|
| 48 |
+
function anyFactory(tests) {
|
| 49 |
+
let checks = [], index = -1;
|
| 50 |
+
for (; ++index < tests.length; )
|
| 51 |
+
checks[index] = convert(tests[index]);
|
| 52 |
+
return castFactory(any);
|
| 53 |
+
function any(...parameters) {
|
| 54 |
+
let index2 = -1;
|
| 55 |
+
for (; ++index2 < checks.length; )
|
| 56 |
+
if (checks[index2].apply(this, parameters)) return !0;
|
| 57 |
+
return !1;
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
function propertiesFactory(check) {
|
| 61 |
+
let checkAsRecord = (
|
| 62 |
+
/** @type {Record<string, unknown>} */
|
| 63 |
+
check
|
| 64 |
+
);
|
| 65 |
+
return castFactory(all);
|
| 66 |
+
function all(node) {
|
| 67 |
+
let nodeAsRecord = (
|
| 68 |
+
/** @type {Record<string, unknown>} */
|
| 69 |
+
/** @type {unknown} */
|
| 70 |
+
node
|
| 71 |
+
), key;
|
| 72 |
+
for (key in check)
|
| 73 |
+
if (nodeAsRecord[key] !== checkAsRecord[key]) return !1;
|
| 74 |
+
return !0;
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
function typeFactory(check) {
|
| 78 |
+
return castFactory(type);
|
| 79 |
+
function type(node) {
|
| 80 |
+
return node && node.type === check;
|
| 81 |
+
}
|
| 82 |
+
}
|
| 83 |
+
function castFactory(testFunction) {
|
| 84 |
+
return check;
|
| 85 |
+
function check(value, index, parent) {
|
| 86 |
+
return !!(looksLikeANode(value) && testFunction.call(
|
| 87 |
+
this,
|
| 88 |
+
value,
|
| 89 |
+
typeof index == "number" ? index : void 0,
|
| 90 |
+
parent || void 0
|
| 91 |
+
));
|
| 92 |
+
}
|
| 93 |
+
}
|
| 94 |
+
function ok() {
|
| 95 |
+
return !0;
|
| 96 |
+
}
|
| 97 |
+
function looksLikeANode(value) {
|
| 98 |
+
return value !== null && typeof value == "object" && "type" in value;
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
// ../../../node_modules/unist-util-visit-parents/lib/color.node.js
|
| 102 |
+
function color(d) {
|
| 103 |
+
return "\x1B[33m" + d + "\x1B[39m";
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
// ../../../node_modules/unist-util-visit-parents/lib/index.js
|
| 107 |
+
var empty = [], CONTINUE = !0, EXIT = !1, SKIP = "skip";
|
| 108 |
+
function visitParents(tree, test, visitor, reverse) {
|
| 109 |
+
let check;
|
| 110 |
+
typeof test == "function" && typeof visitor != "function" ? (reverse = visitor, visitor = test) : check = test;
|
| 111 |
+
let is2 = convert(check), step = reverse ? -1 : 1;
|
| 112 |
+
factory(tree, void 0, [])();
|
| 113 |
+
function factory(node, index, parents) {
|
| 114 |
+
let value = (
|
| 115 |
+
/** @type {Record<string, unknown>} */
|
| 116 |
+
node && typeof node == "object" ? node : {}
|
| 117 |
+
);
|
| 118 |
+
if (typeof value.type == "string") {
|
| 119 |
+
let name = (
|
| 120 |
+
// `hast`
|
| 121 |
+
typeof value.tagName == "string" ? value.tagName : (
|
| 122 |
+
// `xast`
|
| 123 |
+
typeof value.name == "string" ? value.name : void 0
|
| 124 |
+
)
|
| 125 |
+
);
|
| 126 |
+
Object.defineProperty(visit2, "name", {
|
| 127 |
+
value: "node (" + color(node.type + (name ? "<" + name + ">" : "")) + ")"
|
| 128 |
+
});
|
| 129 |
+
}
|
| 130 |
+
return visit2;
|
| 131 |
+
function visit2() {
|
| 132 |
+
let result = empty, subresult, offset, grandparents;
|
| 133 |
+
if ((!test || is2(node, index, parents[parents.length - 1] || void 0)) && (result = toResult(visitor(node, parents)), result[0] === EXIT))
|
| 134 |
+
return result;
|
| 135 |
+
if ("children" in node && node.children) {
|
| 136 |
+
let nodeAsParent = (
|
| 137 |
+
/** @type {UnistParent} */
|
| 138 |
+
node
|
| 139 |
+
);
|
| 140 |
+
if (nodeAsParent.children && result[0] !== SKIP)
|
| 141 |
+
for (offset = (reverse ? nodeAsParent.children.length : -1) + step, grandparents = parents.concat(nodeAsParent); offset > -1 && offset < nodeAsParent.children.length; ) {
|
| 142 |
+
let child = nodeAsParent.children[offset];
|
| 143 |
+
if (subresult = factory(child, offset, grandparents)(), subresult[0] === EXIT)
|
| 144 |
+
return subresult;
|
| 145 |
+
offset = typeof subresult[1] == "number" ? subresult[1] : offset + step;
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
return result;
|
| 149 |
+
}
|
| 150 |
+
}
|
| 151 |
+
}
|
| 152 |
+
function toResult(value) {
|
| 153 |
+
return Array.isArray(value) ? value : typeof value == "number" ? [CONTINUE, value] : value == null ? empty : [value];
|
| 154 |
+
}
|
| 155 |
+
|
| 156 |
+
// ../../../node_modules/unist-util-visit/lib/index.js
|
| 157 |
+
function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
|
| 158 |
+
let reverse, test, visitor;
|
| 159 |
+
typeof testOrVisitor == "function" && typeof visitorOrReverse != "function" ? (test = void 0, visitor = testOrVisitor, reverse = visitorOrReverse) : (test = testOrVisitor, visitor = visitorOrReverse, reverse = maybeReverse), visitParents(tree, test, overload, reverse);
|
| 160 |
+
function overload(node, parents) {
|
| 161 |
+
let parent = parents[parents.length - 1], index = parent ? parent.children.indexOf(node) : void 0;
|
| 162 |
+
return visitor(node, index, parent);
|
| 163 |
+
}
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
export {
|
| 167 |
+
visit
|
| 168 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/chunk-G6W4HXRC.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import CJS_COMPAT_NODE_URL_t17piavj1z from 'node:url';
|
| 2 |
+
import CJS_COMPAT_NODE_PATH_t17piavj1z from 'node:path';
|
| 3 |
+
import CJS_COMPAT_NODE_MODULE_t17piavj1z from "node:module";
|
| 4 |
+
|
| 5 |
+
var __filename = CJS_COMPAT_NODE_URL_t17piavj1z.fileURLToPath(import.meta.url);
|
| 6 |
+
var __dirname = CJS_COMPAT_NODE_PATH_t17piavj1z.dirname(__filename);
|
| 7 |
+
var require = CJS_COMPAT_NODE_MODULE_t17piavj1z.createRequire(import.meta.url);
|
| 8 |
+
|
| 9 |
+
// ------------------------------------------------------------
|
| 10 |
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
| 11 |
+
// ------------------------------------------------------------
|
| 12 |
+
var __create = Object.create;
|
| 13 |
+
var __defProp = Object.defineProperty;
|
| 14 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 15 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 16 |
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 17 |
+
var __commonJS = (cb, mod) => function() {
|
| 18 |
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
| 19 |
+
};
|
| 20 |
+
var __export = (target, all) => {
|
| 21 |
+
for (var name in all)
|
| 22 |
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
| 23 |
+
}, __copyProps = (to, from, except, desc) => {
|
| 24 |
+
if (from && typeof from == "object" || typeof from == "function")
|
| 25 |
+
for (let key of __getOwnPropNames(from))
|
| 26 |
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
| 27 |
+
return to;
|
| 28 |
+
};
|
| 29 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
| 30 |
+
// If the importer is in node compatibility mode or this is not an ESM
|
| 31 |
+
// file that has been converted to a CommonJS file using a Babel-
|
| 32 |
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
| 33 |
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
| 34 |
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
| 35 |
+
mod
|
| 36 |
+
));
|
| 37 |
+
|
| 38 |
+
export {
|
| 39 |
+
__commonJS,
|
| 40 |
+
__export,
|
| 41 |
+
__toESM
|
| 42 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/chunk-SOR3F7GI.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/mdx-plugin-P3ASKRBX.js
ADDED
|
@@ -0,0 +1,1032 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import CJS_COMPAT_NODE_URL_t17piavj1z from 'node:url';
|
| 2 |
+
import CJS_COMPAT_NODE_PATH_t17piavj1z from 'node:path';
|
| 3 |
+
import CJS_COMPAT_NODE_MODULE_t17piavj1z from "node:module";
|
| 4 |
+
|
| 5 |
+
var __filename = CJS_COMPAT_NODE_URL_t17piavj1z.fileURLToPath(import.meta.url);
|
| 6 |
+
var __dirname = CJS_COMPAT_NODE_PATH_t17piavj1z.dirname(__filename);
|
| 7 |
+
var require = CJS_COMPAT_NODE_MODULE_t17piavj1z.createRequire(import.meta.url);
|
| 8 |
+
|
| 9 |
+
// ------------------------------------------------------------
|
| 10 |
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
| 11 |
+
// ------------------------------------------------------------
|
| 12 |
+
import {
|
| 13 |
+
compile
|
| 14 |
+
} from "./chunk-SOR3F7GI.js";
|
| 15 |
+
import "./chunk-2SCGLXP5.js";
|
| 16 |
+
import "./chunk-4WYSRR6Q.js";
|
| 17 |
+
import {
|
| 18 |
+
__commonJS,
|
| 19 |
+
__toESM
|
| 20 |
+
} from "./chunk-G6W4HXRC.js";
|
| 21 |
+
|
| 22 |
+
// ../../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/constants.js
|
| 23 |
+
var require_constants = __commonJS({
|
| 24 |
+
"../../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/constants.js"(exports, module) {
|
| 25 |
+
"use strict";
|
| 26 |
+
var WIN_NO_SLASH = "[^\\\\/]", ONE_CHAR = "(?=.)", QMARK = "[^/]", END_ANCHOR = "(?:\\/|$)", START_ANCHOR = "(?:^|\\/)", DOTS_SLASH = `\\.{1,2}${END_ANCHOR}`, NO_DOT = "(?!\\.)", NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`, NO_DOT_SLASH = `(?!\\.{0,1}${END_ANCHOR})`, NO_DOTS_SLASH = `(?!${DOTS_SLASH})`, QMARK_NO_DOT = "[^.\\/]", STAR = `${QMARK}*?`, SEP = "/", POSIX_CHARS = {
|
| 27 |
+
DOT_LITERAL: "\\.",
|
| 28 |
+
PLUS_LITERAL: "\\+",
|
| 29 |
+
QMARK_LITERAL: "\\?",
|
| 30 |
+
SLASH_LITERAL: "\\/",
|
| 31 |
+
ONE_CHAR,
|
| 32 |
+
QMARK,
|
| 33 |
+
END_ANCHOR,
|
| 34 |
+
DOTS_SLASH,
|
| 35 |
+
NO_DOT,
|
| 36 |
+
NO_DOTS,
|
| 37 |
+
NO_DOT_SLASH,
|
| 38 |
+
NO_DOTS_SLASH,
|
| 39 |
+
QMARK_NO_DOT,
|
| 40 |
+
STAR,
|
| 41 |
+
START_ANCHOR,
|
| 42 |
+
SEP
|
| 43 |
+
}, WINDOWS_CHARS = {
|
| 44 |
+
...POSIX_CHARS,
|
| 45 |
+
SLASH_LITERAL: "[\\\\/]",
|
| 46 |
+
QMARK: WIN_NO_SLASH,
|
| 47 |
+
STAR: `${WIN_NO_SLASH}*?`,
|
| 48 |
+
DOTS_SLASH: "\\.{1,2}(?:[\\\\/]|$)",
|
| 49 |
+
NO_DOT: "(?!\\.)",
|
| 50 |
+
NO_DOTS: "(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",
|
| 51 |
+
NO_DOT_SLASH: "(?!\\.{0,1}(?:[\\\\/]|$))",
|
| 52 |
+
NO_DOTS_SLASH: "(?!\\.{1,2}(?:[\\\\/]|$))",
|
| 53 |
+
QMARK_NO_DOT: "[^.\\\\/]",
|
| 54 |
+
START_ANCHOR: "(?:^|[\\\\/])",
|
| 55 |
+
END_ANCHOR: "(?:[\\\\/]|$)",
|
| 56 |
+
SEP: "\\"
|
| 57 |
+
}, POSIX_REGEX_SOURCE = {
|
| 58 |
+
alnum: "a-zA-Z0-9",
|
| 59 |
+
alpha: "a-zA-Z",
|
| 60 |
+
ascii: "\\x00-\\x7F",
|
| 61 |
+
blank: " \\t",
|
| 62 |
+
cntrl: "\\x00-\\x1F\\x7F",
|
| 63 |
+
digit: "0-9",
|
| 64 |
+
graph: "\\x21-\\x7E",
|
| 65 |
+
lower: "a-z",
|
| 66 |
+
print: "\\x20-\\x7E ",
|
| 67 |
+
punct: "\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",
|
| 68 |
+
space: " \\t\\r\\n\\v\\f",
|
| 69 |
+
upper: "A-Z",
|
| 70 |
+
word: "A-Za-z0-9_",
|
| 71 |
+
xdigit: "A-Fa-f0-9"
|
| 72 |
+
};
|
| 73 |
+
module.exports = {
|
| 74 |
+
MAX_LENGTH: 1024 * 64,
|
| 75 |
+
POSIX_REGEX_SOURCE,
|
| 76 |
+
// regular expressions
|
| 77 |
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
| 78 |
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
| 79 |
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
| 80 |
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
| 81 |
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
| 82 |
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
| 83 |
+
// Replace globs with equivalent patterns to reduce parsing time.
|
| 84 |
+
REPLACEMENTS: {
|
| 85 |
+
__proto__: null,
|
| 86 |
+
"***": "*",
|
| 87 |
+
"**/**": "**",
|
| 88 |
+
"**/**/**": "**"
|
| 89 |
+
},
|
| 90 |
+
// Digits
|
| 91 |
+
CHAR_0: 48,
|
| 92 |
+
/* 0 */
|
| 93 |
+
CHAR_9: 57,
|
| 94 |
+
/* 9 */
|
| 95 |
+
// Alphabet chars.
|
| 96 |
+
CHAR_UPPERCASE_A: 65,
|
| 97 |
+
/* A */
|
| 98 |
+
CHAR_LOWERCASE_A: 97,
|
| 99 |
+
/* a */
|
| 100 |
+
CHAR_UPPERCASE_Z: 90,
|
| 101 |
+
/* Z */
|
| 102 |
+
CHAR_LOWERCASE_Z: 122,
|
| 103 |
+
/* z */
|
| 104 |
+
CHAR_LEFT_PARENTHESES: 40,
|
| 105 |
+
/* ( */
|
| 106 |
+
CHAR_RIGHT_PARENTHESES: 41,
|
| 107 |
+
/* ) */
|
| 108 |
+
CHAR_ASTERISK: 42,
|
| 109 |
+
/* * */
|
| 110 |
+
// Non-alphabetic chars.
|
| 111 |
+
CHAR_AMPERSAND: 38,
|
| 112 |
+
/* & */
|
| 113 |
+
CHAR_AT: 64,
|
| 114 |
+
/* @ */
|
| 115 |
+
CHAR_BACKWARD_SLASH: 92,
|
| 116 |
+
/* \ */
|
| 117 |
+
CHAR_CARRIAGE_RETURN: 13,
|
| 118 |
+
/* \r */
|
| 119 |
+
CHAR_CIRCUMFLEX_ACCENT: 94,
|
| 120 |
+
/* ^ */
|
| 121 |
+
CHAR_COLON: 58,
|
| 122 |
+
/* : */
|
| 123 |
+
CHAR_COMMA: 44,
|
| 124 |
+
/* , */
|
| 125 |
+
CHAR_DOT: 46,
|
| 126 |
+
/* . */
|
| 127 |
+
CHAR_DOUBLE_QUOTE: 34,
|
| 128 |
+
/* " */
|
| 129 |
+
CHAR_EQUAL: 61,
|
| 130 |
+
/* = */
|
| 131 |
+
CHAR_EXCLAMATION_MARK: 33,
|
| 132 |
+
/* ! */
|
| 133 |
+
CHAR_FORM_FEED: 12,
|
| 134 |
+
/* \f */
|
| 135 |
+
CHAR_FORWARD_SLASH: 47,
|
| 136 |
+
/* / */
|
| 137 |
+
CHAR_GRAVE_ACCENT: 96,
|
| 138 |
+
/* ` */
|
| 139 |
+
CHAR_HASH: 35,
|
| 140 |
+
/* # */
|
| 141 |
+
CHAR_HYPHEN_MINUS: 45,
|
| 142 |
+
/* - */
|
| 143 |
+
CHAR_LEFT_ANGLE_BRACKET: 60,
|
| 144 |
+
/* < */
|
| 145 |
+
CHAR_LEFT_CURLY_BRACE: 123,
|
| 146 |
+
/* { */
|
| 147 |
+
CHAR_LEFT_SQUARE_BRACKET: 91,
|
| 148 |
+
/* [ */
|
| 149 |
+
CHAR_LINE_FEED: 10,
|
| 150 |
+
/* \n */
|
| 151 |
+
CHAR_NO_BREAK_SPACE: 160,
|
| 152 |
+
/* \u00A0 */
|
| 153 |
+
CHAR_PERCENT: 37,
|
| 154 |
+
/* % */
|
| 155 |
+
CHAR_PLUS: 43,
|
| 156 |
+
/* + */
|
| 157 |
+
CHAR_QUESTION_MARK: 63,
|
| 158 |
+
/* ? */
|
| 159 |
+
CHAR_RIGHT_ANGLE_BRACKET: 62,
|
| 160 |
+
/* > */
|
| 161 |
+
CHAR_RIGHT_CURLY_BRACE: 125,
|
| 162 |
+
/* } */
|
| 163 |
+
CHAR_RIGHT_SQUARE_BRACKET: 93,
|
| 164 |
+
/* ] */
|
| 165 |
+
CHAR_SEMICOLON: 59,
|
| 166 |
+
/* ; */
|
| 167 |
+
CHAR_SINGLE_QUOTE: 39,
|
| 168 |
+
/* ' */
|
| 169 |
+
CHAR_SPACE: 32,
|
| 170 |
+
/* */
|
| 171 |
+
CHAR_TAB: 9,
|
| 172 |
+
/* \t */
|
| 173 |
+
CHAR_UNDERSCORE: 95,
|
| 174 |
+
/* _ */
|
| 175 |
+
CHAR_VERTICAL_LINE: 124,
|
| 176 |
+
/* | */
|
| 177 |
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
| 178 |
+
/* \uFEFF */
|
| 179 |
+
/**
|
| 180 |
+
* Create EXTGLOB_CHARS
|
| 181 |
+
*/
|
| 182 |
+
extglobChars(chars) {
|
| 183 |
+
return {
|
| 184 |
+
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
| 185 |
+
"?": { type: "qmark", open: "(?:", close: ")?" },
|
| 186 |
+
"+": { type: "plus", open: "(?:", close: ")+" },
|
| 187 |
+
"*": { type: "star", open: "(?:", close: ")*" },
|
| 188 |
+
"@": { type: "at", open: "(?:", close: ")" }
|
| 189 |
+
};
|
| 190 |
+
},
|
| 191 |
+
/**
|
| 192 |
+
* Create GLOB_CHARS
|
| 193 |
+
*/
|
| 194 |
+
globChars(win322) {
|
| 195 |
+
return win322 === !0 ? WINDOWS_CHARS : POSIX_CHARS;
|
| 196 |
+
}
|
| 197 |
+
};
|
| 198 |
+
}
|
| 199 |
+
});
|
| 200 |
+
|
| 201 |
+
// ../../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/utils.js
|
| 202 |
+
var require_utils = __commonJS({
|
| 203 |
+
"../../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/utils.js"(exports) {
|
| 204 |
+
"use strict";
|
| 205 |
+
var {
|
| 206 |
+
REGEX_BACKSLASH,
|
| 207 |
+
REGEX_REMOVE_BACKSLASH,
|
| 208 |
+
REGEX_SPECIAL_CHARS,
|
| 209 |
+
REGEX_SPECIAL_CHARS_GLOBAL
|
| 210 |
+
} = require_constants();
|
| 211 |
+
exports.isObject = (val) => val !== null && typeof val == "object" && !Array.isArray(val);
|
| 212 |
+
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
| 213 |
+
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
| 214 |
+
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
| 215 |
+
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
| 216 |
+
exports.isWindows = () => {
|
| 217 |
+
if (typeof navigator < "u" && navigator.platform) {
|
| 218 |
+
let platform = navigator.platform.toLowerCase();
|
| 219 |
+
return platform === "win32" || platform === "windows";
|
| 220 |
+
}
|
| 221 |
+
return typeof process < "u" && process.platform ? process.platform === "win32" : !1;
|
| 222 |
+
};
|
| 223 |
+
exports.removeBackslashes = (str) => str.replace(REGEX_REMOVE_BACKSLASH, (match) => match === "\\" ? "" : match);
|
| 224 |
+
exports.escapeLast = (input, char, lastIdx) => {
|
| 225 |
+
let idx = input.lastIndexOf(char, lastIdx);
|
| 226 |
+
return idx === -1 ? input : input[idx - 1] === "\\" ? exports.escapeLast(input, char, idx - 1) : `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
| 227 |
+
};
|
| 228 |
+
exports.removePrefix = (input, state = {}) => {
|
| 229 |
+
let output = input;
|
| 230 |
+
return output.startsWith("./") && (output = output.slice(2), state.prefix = "./"), output;
|
| 231 |
+
};
|
| 232 |
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
| 233 |
+
let prepend = options.contains ? "" : "^", append = options.contains ? "" : "$", output = `${prepend}(?:${input})${append}`;
|
| 234 |
+
return state.negated === !0 && (output = `(?:^(?!${output}).*$)`), output;
|
| 235 |
+
};
|
| 236 |
+
exports.basename = (path, { windows } = {}) => {
|
| 237 |
+
let segs = path.split(windows ? /[\\/]/ : "/"), last = segs[segs.length - 1];
|
| 238 |
+
return last === "" ? segs[segs.length - 2] : last;
|
| 239 |
+
};
|
| 240 |
+
}
|
| 241 |
+
});
|
| 242 |
+
|
| 243 |
+
// ../../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/scan.js
|
| 244 |
+
var require_scan = __commonJS({
|
| 245 |
+
"../../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/scan.js"(exports, module) {
|
| 246 |
+
"use strict";
|
| 247 |
+
var utils = require_utils(), {
|
| 248 |
+
CHAR_ASTERISK,
|
| 249 |
+
/* * */
|
| 250 |
+
CHAR_AT,
|
| 251 |
+
/* @ */
|
| 252 |
+
CHAR_BACKWARD_SLASH,
|
| 253 |
+
/* \ */
|
| 254 |
+
CHAR_COMMA,
|
| 255 |
+
/* , */
|
| 256 |
+
CHAR_DOT,
|
| 257 |
+
/* . */
|
| 258 |
+
CHAR_EXCLAMATION_MARK,
|
| 259 |
+
/* ! */
|
| 260 |
+
CHAR_FORWARD_SLASH,
|
| 261 |
+
/* / */
|
| 262 |
+
CHAR_LEFT_CURLY_BRACE,
|
| 263 |
+
/* { */
|
| 264 |
+
CHAR_LEFT_PARENTHESES,
|
| 265 |
+
/* ( */
|
| 266 |
+
CHAR_LEFT_SQUARE_BRACKET,
|
| 267 |
+
/* [ */
|
| 268 |
+
CHAR_PLUS,
|
| 269 |
+
/* + */
|
| 270 |
+
CHAR_QUESTION_MARK,
|
| 271 |
+
/* ? */
|
| 272 |
+
CHAR_RIGHT_CURLY_BRACE,
|
| 273 |
+
/* } */
|
| 274 |
+
CHAR_RIGHT_PARENTHESES,
|
| 275 |
+
/* ) */
|
| 276 |
+
CHAR_RIGHT_SQUARE_BRACKET
|
| 277 |
+
/* ] */
|
| 278 |
+
} = require_constants(), isPathSeparator = (code) => code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH, depth = (token) => {
|
| 279 |
+
token.isPrefix !== !0 && (token.depth = token.isGlobstar ? 1 / 0 : 1);
|
| 280 |
+
}, scan = (input, options) => {
|
| 281 |
+
let opts = options || {}, length = input.length - 1, scanToEnd = opts.parts === !0 || opts.scanToEnd === !0, slashes = [], tokens = [], parts = [], str = input, index = -1, start = 0, lastIndex = 0, isBrace = !1, isBracket = !1, isGlob = !1, isExtglob = !1, isGlobstar = !1, braceEscaped = !1, backslashes = !1, negated = !1, negatedExtglob = !1, finished = !1, braces = 0, prev, code, token = { value: "", depth: 0, isGlob: !1 }, eos = () => index >= length, peek = () => str.charCodeAt(index + 1), advance = () => (prev = code, str.charCodeAt(++index));
|
| 282 |
+
for (; index < length; ) {
|
| 283 |
+
code = advance();
|
| 284 |
+
let next;
|
| 285 |
+
if (code === CHAR_BACKWARD_SLASH) {
|
| 286 |
+
backslashes = token.backslashes = !0, code = advance(), code === CHAR_LEFT_CURLY_BRACE && (braceEscaped = !0);
|
| 287 |
+
continue;
|
| 288 |
+
}
|
| 289 |
+
if (braceEscaped === !0 || code === CHAR_LEFT_CURLY_BRACE) {
|
| 290 |
+
for (braces++; eos() !== !0 && (code = advance()); ) {
|
| 291 |
+
if (code === CHAR_BACKWARD_SLASH) {
|
| 292 |
+
backslashes = token.backslashes = !0, advance();
|
| 293 |
+
continue;
|
| 294 |
+
}
|
| 295 |
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
| 296 |
+
braces++;
|
| 297 |
+
continue;
|
| 298 |
+
}
|
| 299 |
+
if (braceEscaped !== !0 && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
| 300 |
+
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
| 301 |
+
continue;
|
| 302 |
+
break;
|
| 303 |
+
}
|
| 304 |
+
if (braceEscaped !== !0 && code === CHAR_COMMA) {
|
| 305 |
+
if (isBrace = token.isBrace = !0, isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
| 306 |
+
continue;
|
| 307 |
+
break;
|
| 308 |
+
}
|
| 309 |
+
if (code === CHAR_RIGHT_CURLY_BRACE && (braces--, braces === 0)) {
|
| 310 |
+
braceEscaped = !1, isBrace = token.isBrace = !0, finished = !0;
|
| 311 |
+
break;
|
| 312 |
+
}
|
| 313 |
+
}
|
| 314 |
+
if (scanToEnd === !0)
|
| 315 |
+
continue;
|
| 316 |
+
break;
|
| 317 |
+
}
|
| 318 |
+
if (code === CHAR_FORWARD_SLASH) {
|
| 319 |
+
if (slashes.push(index), tokens.push(token), token = { value: "", depth: 0, isGlob: !1 }, finished === !0) continue;
|
| 320 |
+
if (prev === CHAR_DOT && index === start + 1) {
|
| 321 |
+
start += 2;
|
| 322 |
+
continue;
|
| 323 |
+
}
|
| 324 |
+
lastIndex = index + 1;
|
| 325 |
+
continue;
|
| 326 |
+
}
|
| 327 |
+
if (opts.noext !== !0 && (code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === !0 && peek() === CHAR_LEFT_PARENTHESES) {
|
| 328 |
+
if (isGlob = token.isGlob = !0, isExtglob = token.isExtglob = !0, finished = !0, code === CHAR_EXCLAMATION_MARK && index === start && (negatedExtglob = !0), scanToEnd === !0) {
|
| 329 |
+
for (; eos() !== !0 && (code = advance()); ) {
|
| 330 |
+
if (code === CHAR_BACKWARD_SLASH) {
|
| 331 |
+
backslashes = token.backslashes = !0, code = advance();
|
| 332 |
+
continue;
|
| 333 |
+
}
|
| 334 |
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
| 335 |
+
isGlob = token.isGlob = !0, finished = !0;
|
| 336 |
+
break;
|
| 337 |
+
}
|
| 338 |
+
}
|
| 339 |
+
continue;
|
| 340 |
+
}
|
| 341 |
+
break;
|
| 342 |
+
}
|
| 343 |
+
if (code === CHAR_ASTERISK) {
|
| 344 |
+
if (prev === CHAR_ASTERISK && (isGlobstar = token.isGlobstar = !0), isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
| 345 |
+
continue;
|
| 346 |
+
break;
|
| 347 |
+
}
|
| 348 |
+
if (code === CHAR_QUESTION_MARK) {
|
| 349 |
+
if (isGlob = token.isGlob = !0, finished = !0, scanToEnd === !0)
|
| 350 |
+
continue;
|
| 351 |
+
break;
|
| 352 |
+
}
|
| 353 |
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
| 354 |
+
for (; eos() !== !0 && (next = advance()); ) {
|
| 355 |
+
if (next === CHAR_BACKWARD_SLASH) {
|
| 356 |
+
backslashes = token.backslashes = !0, advance();
|
| 357 |
+
continue;
|
| 358 |
+
}
|
| 359 |
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
| 360 |
+
isBracket = token.isBracket = !0, isGlob = token.isGlob = !0, finished = !0;
|
| 361 |
+
break;
|
| 362 |
+
}
|
| 363 |
+
}
|
| 364 |
+
if (scanToEnd === !0)
|
| 365 |
+
continue;
|
| 366 |
+
break;
|
| 367 |
+
}
|
| 368 |
+
if (opts.nonegate !== !0 && code === CHAR_EXCLAMATION_MARK && index === start) {
|
| 369 |
+
negated = token.negated = !0, start++;
|
| 370 |
+
continue;
|
| 371 |
+
}
|
| 372 |
+
if (opts.noparen !== !0 && code === CHAR_LEFT_PARENTHESES) {
|
| 373 |
+
if (isGlob = token.isGlob = !0, scanToEnd === !0) {
|
| 374 |
+
for (; eos() !== !0 && (code = advance()); ) {
|
| 375 |
+
if (code === CHAR_LEFT_PARENTHESES) {
|
| 376 |
+
backslashes = token.backslashes = !0, code = advance();
|
| 377 |
+
continue;
|
| 378 |
+
}
|
| 379 |
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
| 380 |
+
finished = !0;
|
| 381 |
+
break;
|
| 382 |
+
}
|
| 383 |
+
}
|
| 384 |
+
continue;
|
| 385 |
+
}
|
| 386 |
+
break;
|
| 387 |
+
}
|
| 388 |
+
if (isGlob === !0) {
|
| 389 |
+
if (finished = !0, scanToEnd === !0)
|
| 390 |
+
continue;
|
| 391 |
+
break;
|
| 392 |
+
}
|
| 393 |
+
}
|
| 394 |
+
opts.noext === !0 && (isExtglob = !1, isGlob = !1);
|
| 395 |
+
let base = str, prefix = "", glob = "";
|
| 396 |
+
start > 0 && (prefix = str.slice(0, start), str = str.slice(start), lastIndex -= start), base && isGlob === !0 && lastIndex > 0 ? (base = str.slice(0, lastIndex), glob = str.slice(lastIndex)) : isGlob === !0 ? (base = "", glob = str) : base = str, base && base !== "" && base !== "/" && base !== str && isPathSeparator(base.charCodeAt(base.length - 1)) && (base = base.slice(0, -1)), opts.unescape === !0 && (glob && (glob = utils.removeBackslashes(glob)), base && backslashes === !0 && (base = utils.removeBackslashes(base)));
|
| 397 |
+
let state = {
|
| 398 |
+
prefix,
|
| 399 |
+
input,
|
| 400 |
+
start,
|
| 401 |
+
base,
|
| 402 |
+
glob,
|
| 403 |
+
isBrace,
|
| 404 |
+
isBracket,
|
| 405 |
+
isGlob,
|
| 406 |
+
isExtglob,
|
| 407 |
+
isGlobstar,
|
| 408 |
+
negated,
|
| 409 |
+
negatedExtglob
|
| 410 |
+
};
|
| 411 |
+
if (opts.tokens === !0 && (state.maxDepth = 0, isPathSeparator(code) || tokens.push(token), state.tokens = tokens), opts.parts === !0 || opts.tokens === !0) {
|
| 412 |
+
let prevIndex;
|
| 413 |
+
for (let idx = 0; idx < slashes.length; idx++) {
|
| 414 |
+
let n = prevIndex ? prevIndex + 1 : start, i = slashes[idx], value = input.slice(n, i);
|
| 415 |
+
opts.tokens && (idx === 0 && start !== 0 ? (tokens[idx].isPrefix = !0, tokens[idx].value = prefix) : tokens[idx].value = value, depth(tokens[idx]), state.maxDepth += tokens[idx].depth), (idx !== 0 || value !== "") && parts.push(value), prevIndex = i;
|
| 416 |
+
}
|
| 417 |
+
if (prevIndex && prevIndex + 1 < input.length) {
|
| 418 |
+
let value = input.slice(prevIndex + 1);
|
| 419 |
+
parts.push(value), opts.tokens && (tokens[tokens.length - 1].value = value, depth(tokens[tokens.length - 1]), state.maxDepth += tokens[tokens.length - 1].depth);
|
| 420 |
+
}
|
| 421 |
+
state.slashes = slashes, state.parts = parts;
|
| 422 |
+
}
|
| 423 |
+
return state;
|
| 424 |
+
};
|
| 425 |
+
module.exports = scan;
|
| 426 |
+
}
|
| 427 |
+
});
|
| 428 |
+
|
| 429 |
+
// ../../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/parse.js
|
| 430 |
+
var require_parse = __commonJS({
|
| 431 |
+
"../../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/parse.js"(exports, module) {
|
| 432 |
+
"use strict";
|
| 433 |
+
var constants = require_constants(), utils = require_utils(), {
|
| 434 |
+
MAX_LENGTH,
|
| 435 |
+
POSIX_REGEX_SOURCE,
|
| 436 |
+
REGEX_NON_SPECIAL_CHARS,
|
| 437 |
+
REGEX_SPECIAL_CHARS_BACKREF,
|
| 438 |
+
REPLACEMENTS
|
| 439 |
+
} = constants, expandRange = (args, options) => {
|
| 440 |
+
if (typeof options.expandRange == "function")
|
| 441 |
+
return options.expandRange(...args, options);
|
| 442 |
+
args.sort();
|
| 443 |
+
let value = `[${args.join("-")}]`;
|
| 444 |
+
try {
|
| 445 |
+
new RegExp(value);
|
| 446 |
+
} catch {
|
| 447 |
+
return args.map((v) => utils.escapeRegex(v)).join("..");
|
| 448 |
+
}
|
| 449 |
+
return value;
|
| 450 |
+
}, syntaxError = (type, char) => `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`, parse = (input, options) => {
|
| 451 |
+
if (typeof input != "string")
|
| 452 |
+
throw new TypeError("Expected a string");
|
| 453 |
+
input = REPLACEMENTS[input] || input;
|
| 454 |
+
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
| 455 |
+
if (len > max)
|
| 456 |
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
| 457 |
+
let bos = { type: "bos", value: "", output: opts.prepend || "" }, tokens = [bos], capture = opts.capture ? "" : "?:", PLATFORM_CHARS = constants.globChars(opts.windows), EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS), {
|
| 458 |
+
DOT_LITERAL,
|
| 459 |
+
PLUS_LITERAL,
|
| 460 |
+
SLASH_LITERAL,
|
| 461 |
+
ONE_CHAR,
|
| 462 |
+
DOTS_SLASH,
|
| 463 |
+
NO_DOT,
|
| 464 |
+
NO_DOT_SLASH,
|
| 465 |
+
NO_DOTS_SLASH,
|
| 466 |
+
QMARK,
|
| 467 |
+
QMARK_NO_DOT,
|
| 468 |
+
STAR,
|
| 469 |
+
START_ANCHOR
|
| 470 |
+
} = PLATFORM_CHARS, globstar = (opts2) => `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, nodot = opts.dot ? "" : NO_DOT, qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT, star = opts.bash === !0 ? globstar(opts) : STAR;
|
| 471 |
+
opts.capture && (star = `(${star})`), typeof opts.noext == "boolean" && (opts.noextglob = opts.noext);
|
| 472 |
+
let state = {
|
| 473 |
+
input,
|
| 474 |
+
index: -1,
|
| 475 |
+
start: 0,
|
| 476 |
+
dot: opts.dot === !0,
|
| 477 |
+
consumed: "",
|
| 478 |
+
output: "",
|
| 479 |
+
prefix: "",
|
| 480 |
+
backtrack: !1,
|
| 481 |
+
negated: !1,
|
| 482 |
+
brackets: 0,
|
| 483 |
+
braces: 0,
|
| 484 |
+
parens: 0,
|
| 485 |
+
quotes: 0,
|
| 486 |
+
globstar: !1,
|
| 487 |
+
tokens
|
| 488 |
+
};
|
| 489 |
+
input = utils.removePrefix(input, state), len = input.length;
|
| 490 |
+
let extglobs = [], braces = [], stack = [], prev = bos, value, eos = () => state.index === len - 1, peek = state.peek = (n = 1) => input[state.index + n], advance = state.advance = () => input[++state.index] || "", remaining = () => input.slice(state.index + 1), consume = (value2 = "", num = 0) => {
|
| 491 |
+
state.consumed += value2, state.index += num;
|
| 492 |
+
}, append = (token) => {
|
| 493 |
+
state.output += token.output != null ? token.output : token.value, consume(token.value);
|
| 494 |
+
}, negate = () => {
|
| 495 |
+
let count = 1;
|
| 496 |
+
for (; peek() === "!" && (peek(2) !== "(" || peek(3) === "?"); )
|
| 497 |
+
advance(), state.start++, count++;
|
| 498 |
+
return count % 2 === 0 ? !1 : (state.negated = !0, state.start++, !0);
|
| 499 |
+
}, increment = (type) => {
|
| 500 |
+
state[type]++, stack.push(type);
|
| 501 |
+
}, decrement = (type) => {
|
| 502 |
+
state[type]--, stack.pop();
|
| 503 |
+
}, push = (tok) => {
|
| 504 |
+
if (prev.type === "globstar") {
|
| 505 |
+
let isBrace = state.braces > 0 && (tok.type === "comma" || tok.type === "brace"), isExtglob = tok.extglob === !0 || extglobs.length && (tok.type === "pipe" || tok.type === "paren");
|
| 506 |
+
tok.type !== "slash" && tok.type !== "paren" && !isBrace && !isExtglob && (state.output = state.output.slice(0, -prev.output.length), prev.type = "star", prev.value = "*", prev.output = star, state.output += prev.output);
|
| 507 |
+
}
|
| 508 |
+
if (extglobs.length && tok.type !== "paren" && (extglobs[extglobs.length - 1].inner += tok.value), (tok.value || tok.output) && append(tok), prev && prev.type === "text" && tok.type === "text") {
|
| 509 |
+
prev.output = (prev.output || prev.value) + tok.value, prev.value += tok.value;
|
| 510 |
+
return;
|
| 511 |
+
}
|
| 512 |
+
tok.prev = prev, tokens.push(tok), prev = tok;
|
| 513 |
+
}, extglobOpen = (type, value2) => {
|
| 514 |
+
let token = { ...EXTGLOB_CHARS[value2], conditions: 1, inner: "" };
|
| 515 |
+
token.prev = prev, token.parens = state.parens, token.output = state.output;
|
| 516 |
+
let output = (opts.capture ? "(" : "") + token.open;
|
| 517 |
+
increment("parens"), push({ type, value: value2, output: state.output ? "" : ONE_CHAR }), push({ type: "paren", extglob: !0, value: advance(), output }), extglobs.push(token);
|
| 518 |
+
}, extglobClose = (token) => {
|
| 519 |
+
let output = token.close + (opts.capture ? ")" : ""), rest;
|
| 520 |
+
if (token.type === "negate") {
|
| 521 |
+
let extglobStar = star;
|
| 522 |
+
if (token.inner && token.inner.length > 1 && token.inner.includes("/") && (extglobStar = globstar(opts)), (extglobStar !== star || eos() || /^\)+$/.test(remaining())) && (output = token.close = `)$))${extglobStar}`), token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
|
| 523 |
+
let expression = parse(rest, { ...options, fastpaths: !1 }).output;
|
| 524 |
+
output = token.close = `)${expression})${extglobStar})`;
|
| 525 |
+
}
|
| 526 |
+
token.prev.type === "bos" && (state.negatedExtglob = !0);
|
| 527 |
+
}
|
| 528 |
+
push({ type: "paren", extglob: !0, value, output }), decrement("parens");
|
| 529 |
+
};
|
| 530 |
+
if (opts.fastpaths !== !1 && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
| 531 |
+
let backslashes = !1, output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => first === "\\" ? (backslashes = !0, m) : first === "?" ? esc ? esc + first + (rest ? QMARK.repeat(rest.length) : "") : index === 0 ? qmarkNoDot + (rest ? QMARK.repeat(rest.length) : "") : QMARK.repeat(chars.length) : first === "." ? DOT_LITERAL.repeat(chars.length) : first === "*" ? esc ? esc + first + (rest ? star : "") : star : esc ? m : `\\${m}`);
|
| 532 |
+
return backslashes === !0 && (opts.unescape === !0 ? output = output.replace(/\\/g, "") : output = output.replace(/\\+/g, (m) => m.length % 2 === 0 ? "\\\\" : m ? "\\" : "")), output === input && opts.contains === !0 ? (state.output = input, state) : (state.output = utils.wrapOutput(output, state, options), state);
|
| 533 |
+
}
|
| 534 |
+
for (; !eos(); ) {
|
| 535 |
+
if (value = advance(), value === "\0")
|
| 536 |
+
continue;
|
| 537 |
+
if (value === "\\") {
|
| 538 |
+
let next = peek();
|
| 539 |
+
if (next === "/" && opts.bash !== !0 || next === "." || next === ";")
|
| 540 |
+
continue;
|
| 541 |
+
if (!next) {
|
| 542 |
+
value += "\\", push({ type: "text", value });
|
| 543 |
+
continue;
|
| 544 |
+
}
|
| 545 |
+
let match = /^\\+/.exec(remaining()), slashes = 0;
|
| 546 |
+
if (match && match[0].length > 2 && (slashes = match[0].length, state.index += slashes, slashes % 2 !== 0 && (value += "\\")), opts.unescape === !0 ? value = advance() : value += advance(), state.brackets === 0) {
|
| 547 |
+
push({ type: "text", value });
|
| 548 |
+
continue;
|
| 549 |
+
}
|
| 550 |
+
}
|
| 551 |
+
if (state.brackets > 0 && (value !== "]" || prev.value === "[" || prev.value === "[^")) {
|
| 552 |
+
if (opts.posix !== !1 && value === ":") {
|
| 553 |
+
let inner = prev.value.slice(1);
|
| 554 |
+
if (inner.includes("[") && (prev.posix = !0, inner.includes(":"))) {
|
| 555 |
+
let idx = prev.value.lastIndexOf("["), pre = prev.value.slice(0, idx), rest2 = prev.value.slice(idx + 2), posix2 = POSIX_REGEX_SOURCE[rest2];
|
| 556 |
+
if (posix2) {
|
| 557 |
+
prev.value = pre + posix2, state.backtrack = !0, advance(), !bos.output && tokens.indexOf(prev) === 1 && (bos.output = ONE_CHAR);
|
| 558 |
+
continue;
|
| 559 |
+
}
|
| 560 |
+
}
|
| 561 |
+
}
|
| 562 |
+
(value === "[" && peek() !== ":" || value === "-" && peek() === "]") && (value = `\\${value}`), value === "]" && (prev.value === "[" || prev.value === "[^") && (value = `\\${value}`), opts.posix === !0 && value === "!" && prev.value === "[" && (value = "^"), prev.value += value, append({ value });
|
| 563 |
+
continue;
|
| 564 |
+
}
|
| 565 |
+
if (state.quotes === 1 && value !== '"') {
|
| 566 |
+
value = utils.escapeRegex(value), prev.value += value, append({ value });
|
| 567 |
+
continue;
|
| 568 |
+
}
|
| 569 |
+
if (value === '"') {
|
| 570 |
+
state.quotes = state.quotes === 1 ? 0 : 1, opts.keepQuotes === !0 && push({ type: "text", value });
|
| 571 |
+
continue;
|
| 572 |
+
}
|
| 573 |
+
if (value === "(") {
|
| 574 |
+
increment("parens"), push({ type: "paren", value });
|
| 575 |
+
continue;
|
| 576 |
+
}
|
| 577 |
+
if (value === ")") {
|
| 578 |
+
if (state.parens === 0 && opts.strictBrackets === !0)
|
| 579 |
+
throw new SyntaxError(syntaxError("opening", "("));
|
| 580 |
+
let extglob = extglobs[extglobs.length - 1];
|
| 581 |
+
if (extglob && state.parens === extglob.parens + 1) {
|
| 582 |
+
extglobClose(extglobs.pop());
|
| 583 |
+
continue;
|
| 584 |
+
}
|
| 585 |
+
push({ type: "paren", value, output: state.parens ? ")" : "\\)" }), decrement("parens");
|
| 586 |
+
continue;
|
| 587 |
+
}
|
| 588 |
+
if (value === "[") {
|
| 589 |
+
if (opts.nobracket === !0 || !remaining().includes("]")) {
|
| 590 |
+
if (opts.nobracket !== !0 && opts.strictBrackets === !0)
|
| 591 |
+
throw new SyntaxError(syntaxError("closing", "]"));
|
| 592 |
+
value = `\\${value}`;
|
| 593 |
+
} else
|
| 594 |
+
increment("brackets");
|
| 595 |
+
push({ type: "bracket", value });
|
| 596 |
+
continue;
|
| 597 |
+
}
|
| 598 |
+
if (value === "]") {
|
| 599 |
+
if (opts.nobracket === !0 || prev && prev.type === "bracket" && prev.value.length === 1) {
|
| 600 |
+
push({ type: "text", value, output: `\\${value}` });
|
| 601 |
+
continue;
|
| 602 |
+
}
|
| 603 |
+
if (state.brackets === 0) {
|
| 604 |
+
if (opts.strictBrackets === !0)
|
| 605 |
+
throw new SyntaxError(syntaxError("opening", "["));
|
| 606 |
+
push({ type: "text", value, output: `\\${value}` });
|
| 607 |
+
continue;
|
| 608 |
+
}
|
| 609 |
+
decrement("brackets");
|
| 610 |
+
let prevValue = prev.value.slice(1);
|
| 611 |
+
if (prev.posix !== !0 && prevValue[0] === "^" && !prevValue.includes("/") && (value = `/${value}`), prev.value += value, append({ value }), opts.literalBrackets === !1 || utils.hasRegexChars(prevValue))
|
| 612 |
+
continue;
|
| 613 |
+
let escaped = utils.escapeRegex(prev.value);
|
| 614 |
+
if (state.output = state.output.slice(0, -prev.value.length), opts.literalBrackets === !0) {
|
| 615 |
+
state.output += escaped, prev.value = escaped;
|
| 616 |
+
continue;
|
| 617 |
+
}
|
| 618 |
+
prev.value = `(${capture}${escaped}|${prev.value})`, state.output += prev.value;
|
| 619 |
+
continue;
|
| 620 |
+
}
|
| 621 |
+
if (value === "{" && opts.nobrace !== !0) {
|
| 622 |
+
increment("braces");
|
| 623 |
+
let open = {
|
| 624 |
+
type: "brace",
|
| 625 |
+
value,
|
| 626 |
+
output: "(",
|
| 627 |
+
outputIndex: state.output.length,
|
| 628 |
+
tokensIndex: state.tokens.length
|
| 629 |
+
};
|
| 630 |
+
braces.push(open), push(open);
|
| 631 |
+
continue;
|
| 632 |
+
}
|
| 633 |
+
if (value === "}") {
|
| 634 |
+
let brace = braces[braces.length - 1];
|
| 635 |
+
if (opts.nobrace === !0 || !brace) {
|
| 636 |
+
push({ type: "text", value, output: value });
|
| 637 |
+
continue;
|
| 638 |
+
}
|
| 639 |
+
let output = ")";
|
| 640 |
+
if (brace.dots === !0) {
|
| 641 |
+
let arr = tokens.slice(), range = [];
|
| 642 |
+
for (let i = arr.length - 1; i >= 0 && (tokens.pop(), arr[i].type !== "brace"); i--)
|
| 643 |
+
arr[i].type !== "dots" && range.unshift(arr[i].value);
|
| 644 |
+
output = expandRange(range, opts), state.backtrack = !0;
|
| 645 |
+
}
|
| 646 |
+
if (brace.comma !== !0 && brace.dots !== !0) {
|
| 647 |
+
let out = state.output.slice(0, brace.outputIndex), toks = state.tokens.slice(brace.tokensIndex);
|
| 648 |
+
brace.value = brace.output = "\\{", value = output = "\\}", state.output = out;
|
| 649 |
+
for (let t of toks)
|
| 650 |
+
state.output += t.output || t.value;
|
| 651 |
+
}
|
| 652 |
+
push({ type: "brace", value, output }), decrement("braces"), braces.pop();
|
| 653 |
+
continue;
|
| 654 |
+
}
|
| 655 |
+
if (value === "|") {
|
| 656 |
+
extglobs.length > 0 && extglobs[extglobs.length - 1].conditions++, push({ type: "text", value });
|
| 657 |
+
continue;
|
| 658 |
+
}
|
| 659 |
+
if (value === ",") {
|
| 660 |
+
let output = value, brace = braces[braces.length - 1];
|
| 661 |
+
brace && stack[stack.length - 1] === "braces" && (brace.comma = !0, output = "|"), push({ type: "comma", value, output });
|
| 662 |
+
continue;
|
| 663 |
+
}
|
| 664 |
+
if (value === "/") {
|
| 665 |
+
if (prev.type === "dot" && state.index === state.start + 1) {
|
| 666 |
+
state.start = state.index + 1, state.consumed = "", state.output = "", tokens.pop(), prev = bos;
|
| 667 |
+
continue;
|
| 668 |
+
}
|
| 669 |
+
push({ type: "slash", value, output: SLASH_LITERAL });
|
| 670 |
+
continue;
|
| 671 |
+
}
|
| 672 |
+
if (value === ".") {
|
| 673 |
+
if (state.braces > 0 && prev.type === "dot") {
|
| 674 |
+
prev.value === "." && (prev.output = DOT_LITERAL);
|
| 675 |
+
let brace = braces[braces.length - 1];
|
| 676 |
+
prev.type = "dots", prev.output += value, prev.value += value, brace.dots = !0;
|
| 677 |
+
continue;
|
| 678 |
+
}
|
| 679 |
+
if (state.braces + state.parens === 0 && prev.type !== "bos" && prev.type !== "slash") {
|
| 680 |
+
push({ type: "text", value, output: DOT_LITERAL });
|
| 681 |
+
continue;
|
| 682 |
+
}
|
| 683 |
+
push({ type: "dot", value, output: DOT_LITERAL });
|
| 684 |
+
continue;
|
| 685 |
+
}
|
| 686 |
+
if (value === "?") {
|
| 687 |
+
if (!(prev && prev.value === "(") && opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
| 688 |
+
extglobOpen("qmark", value);
|
| 689 |
+
continue;
|
| 690 |
+
}
|
| 691 |
+
if (prev && prev.type === "paren") {
|
| 692 |
+
let next = peek(), output = value;
|
| 693 |
+
(prev.value === "(" && !/[!=<:]/.test(next) || next === "<" && !/<([!=]|\w+>)/.test(remaining())) && (output = `\\${value}`), push({ type: "text", value, output });
|
| 694 |
+
continue;
|
| 695 |
+
}
|
| 696 |
+
if (opts.dot !== !0 && (prev.type === "slash" || prev.type === "bos")) {
|
| 697 |
+
push({ type: "qmark", value, output: QMARK_NO_DOT });
|
| 698 |
+
continue;
|
| 699 |
+
}
|
| 700 |
+
push({ type: "qmark", value, output: QMARK });
|
| 701 |
+
continue;
|
| 702 |
+
}
|
| 703 |
+
if (value === "!") {
|
| 704 |
+
if (opts.noextglob !== !0 && peek() === "(" && (peek(2) !== "?" || !/[!=<:]/.test(peek(3)))) {
|
| 705 |
+
extglobOpen("negate", value);
|
| 706 |
+
continue;
|
| 707 |
+
}
|
| 708 |
+
if (opts.nonegate !== !0 && state.index === 0) {
|
| 709 |
+
negate();
|
| 710 |
+
continue;
|
| 711 |
+
}
|
| 712 |
+
}
|
| 713 |
+
if (value === "+") {
|
| 714 |
+
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
| 715 |
+
extglobOpen("plus", value);
|
| 716 |
+
continue;
|
| 717 |
+
}
|
| 718 |
+
if (prev && prev.value === "(" || opts.regex === !1) {
|
| 719 |
+
push({ type: "plus", value, output: PLUS_LITERAL });
|
| 720 |
+
continue;
|
| 721 |
+
}
|
| 722 |
+
if (prev && (prev.type === "bracket" || prev.type === "paren" || prev.type === "brace") || state.parens > 0) {
|
| 723 |
+
push({ type: "plus", value });
|
| 724 |
+
continue;
|
| 725 |
+
}
|
| 726 |
+
push({ type: "plus", value: PLUS_LITERAL });
|
| 727 |
+
continue;
|
| 728 |
+
}
|
| 729 |
+
if (value === "@") {
|
| 730 |
+
if (opts.noextglob !== !0 && peek() === "(" && peek(2) !== "?") {
|
| 731 |
+
push({ type: "at", extglob: !0, value, output: "" });
|
| 732 |
+
continue;
|
| 733 |
+
}
|
| 734 |
+
push({ type: "text", value });
|
| 735 |
+
continue;
|
| 736 |
+
}
|
| 737 |
+
if (value !== "*") {
|
| 738 |
+
(value === "$" || value === "^") && (value = `\\${value}`);
|
| 739 |
+
let match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
| 740 |
+
match && (value += match[0], state.index += match[0].length), push({ type: "text", value });
|
| 741 |
+
continue;
|
| 742 |
+
}
|
| 743 |
+
if (prev && (prev.type === "globstar" || prev.star === !0)) {
|
| 744 |
+
prev.type = "star", prev.star = !0, prev.value += value, prev.output = star, state.backtrack = !0, state.globstar = !0, consume(value);
|
| 745 |
+
continue;
|
| 746 |
+
}
|
| 747 |
+
let rest = remaining();
|
| 748 |
+
if (opts.noextglob !== !0 && /^\([^?]/.test(rest)) {
|
| 749 |
+
extglobOpen("star", value);
|
| 750 |
+
continue;
|
| 751 |
+
}
|
| 752 |
+
if (prev.type === "star") {
|
| 753 |
+
if (opts.noglobstar === !0) {
|
| 754 |
+
consume(value);
|
| 755 |
+
continue;
|
| 756 |
+
}
|
| 757 |
+
let prior = prev.prev, before = prior.prev, isStart = prior.type === "slash" || prior.type === "bos", afterStar = before && (before.type === "star" || before.type === "globstar");
|
| 758 |
+
if (opts.bash === !0 && (!isStart || rest[0] && rest[0] !== "/")) {
|
| 759 |
+
push({ type: "star", value, output: "" });
|
| 760 |
+
continue;
|
| 761 |
+
}
|
| 762 |
+
let isBrace = state.braces > 0 && (prior.type === "comma" || prior.type === "brace"), isExtglob = extglobs.length && (prior.type === "pipe" || prior.type === "paren");
|
| 763 |
+
if (!isStart && prior.type !== "paren" && !isBrace && !isExtglob) {
|
| 764 |
+
push({ type: "star", value, output: "" });
|
| 765 |
+
continue;
|
| 766 |
+
}
|
| 767 |
+
for (; rest.slice(0, 3) === "/**"; ) {
|
| 768 |
+
let after = input[state.index + 4];
|
| 769 |
+
if (after && after !== "/")
|
| 770 |
+
break;
|
| 771 |
+
rest = rest.slice(3), consume("/**", 3);
|
| 772 |
+
}
|
| 773 |
+
if (prior.type === "bos" && eos()) {
|
| 774 |
+
prev.type = "globstar", prev.value += value, prev.output = globstar(opts), state.output = prev.output, state.globstar = !0, consume(value);
|
| 775 |
+
continue;
|
| 776 |
+
}
|
| 777 |
+
if (prior.type === "slash" && prior.prev.type !== "bos" && !afterStar && eos()) {
|
| 778 |
+
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = globstar(opts) + (opts.strictSlashes ? ")" : "|$)"), prev.value += value, state.globstar = !0, state.output += prior.output + prev.output, consume(value);
|
| 779 |
+
continue;
|
| 780 |
+
}
|
| 781 |
+
if (prior.type === "slash" && prior.prev.type !== "bos" && rest[0] === "/") {
|
| 782 |
+
let end = rest[1] !== void 0 ? "|$" : "";
|
| 783 |
+
state.output = state.output.slice(0, -(prior.output + prev.output).length), prior.output = `(?:${prior.output}`, prev.type = "globstar", prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`, prev.value += value, state.output += prior.output + prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
|
| 784 |
+
continue;
|
| 785 |
+
}
|
| 786 |
+
if (prior.type === "bos" && rest[0] === "/") {
|
| 787 |
+
prev.type = "globstar", prev.value += value, prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`, state.output = prev.output, state.globstar = !0, consume(value + advance()), push({ type: "slash", value: "/", output: "" });
|
| 788 |
+
continue;
|
| 789 |
+
}
|
| 790 |
+
state.output = state.output.slice(0, -prev.output.length), prev.type = "globstar", prev.output = globstar(opts), prev.value += value, state.output += prev.output, state.globstar = !0, consume(value);
|
| 791 |
+
continue;
|
| 792 |
+
}
|
| 793 |
+
let token = { type: "star", value, output: star };
|
| 794 |
+
if (opts.bash === !0) {
|
| 795 |
+
token.output = ".*?", (prev.type === "bos" || prev.type === "slash") && (token.output = nodot + token.output), push(token);
|
| 796 |
+
continue;
|
| 797 |
+
}
|
| 798 |
+
if (prev && (prev.type === "bracket" || prev.type === "paren") && opts.regex === !0) {
|
| 799 |
+
token.output = value, push(token);
|
| 800 |
+
continue;
|
| 801 |
+
}
|
| 802 |
+
(state.index === state.start || prev.type === "slash" || prev.type === "dot") && (prev.type === "dot" ? (state.output += NO_DOT_SLASH, prev.output += NO_DOT_SLASH) : opts.dot === !0 ? (state.output += NO_DOTS_SLASH, prev.output += NO_DOTS_SLASH) : (state.output += nodot, prev.output += nodot), peek() !== "*" && (state.output += ONE_CHAR, prev.output += ONE_CHAR)), push(token);
|
| 803 |
+
}
|
| 804 |
+
for (; state.brackets > 0; ) {
|
| 805 |
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "]"));
|
| 806 |
+
state.output = utils.escapeLast(state.output, "["), decrement("brackets");
|
| 807 |
+
}
|
| 808 |
+
for (; state.parens > 0; ) {
|
| 809 |
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", ")"));
|
| 810 |
+
state.output = utils.escapeLast(state.output, "("), decrement("parens");
|
| 811 |
+
}
|
| 812 |
+
for (; state.braces > 0; ) {
|
| 813 |
+
if (opts.strictBrackets === !0) throw new SyntaxError(syntaxError("closing", "}"));
|
| 814 |
+
state.output = utils.escapeLast(state.output, "{"), decrement("braces");
|
| 815 |
+
}
|
| 816 |
+
if (opts.strictSlashes !== !0 && (prev.type === "star" || prev.type === "bracket") && push({ type: "maybe_slash", value: "", output: `${SLASH_LITERAL}?` }), state.backtrack === !0) {
|
| 817 |
+
state.output = "";
|
| 818 |
+
for (let token of state.tokens)
|
| 819 |
+
state.output += token.output != null ? token.output : token.value, token.suffix && (state.output += token.suffix);
|
| 820 |
+
}
|
| 821 |
+
return state;
|
| 822 |
+
};
|
| 823 |
+
parse.fastpaths = (input, options) => {
|
| 824 |
+
let opts = { ...options }, max = typeof opts.maxLength == "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH, len = input.length;
|
| 825 |
+
if (len > max)
|
| 826 |
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
| 827 |
+
input = REPLACEMENTS[input] || input;
|
| 828 |
+
let {
|
| 829 |
+
DOT_LITERAL,
|
| 830 |
+
SLASH_LITERAL,
|
| 831 |
+
ONE_CHAR,
|
| 832 |
+
DOTS_SLASH,
|
| 833 |
+
NO_DOT,
|
| 834 |
+
NO_DOTS,
|
| 835 |
+
NO_DOTS_SLASH,
|
| 836 |
+
STAR,
|
| 837 |
+
START_ANCHOR
|
| 838 |
+
} = constants.globChars(opts.windows), nodot = opts.dot ? NO_DOTS : NO_DOT, slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT, capture = opts.capture ? "" : "?:", state = { negated: !1, prefix: "" }, star = opts.bash === !0 ? ".*?" : STAR;
|
| 839 |
+
opts.capture && (star = `(${star})`);
|
| 840 |
+
let globstar = (opts2) => opts2.noglobstar === !0 ? star : `(${capture}(?:(?!${START_ANCHOR}${opts2.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`, create = (str) => {
|
| 841 |
+
switch (str) {
|
| 842 |
+
case "*":
|
| 843 |
+
return `${nodot}${ONE_CHAR}${star}`;
|
| 844 |
+
case ".*":
|
| 845 |
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
| 846 |
+
case "*.*":
|
| 847 |
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
| 848 |
+
case "*/*":
|
| 849 |
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
| 850 |
+
case "**":
|
| 851 |
+
return nodot + globstar(opts);
|
| 852 |
+
case "**/*":
|
| 853 |
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
| 854 |
+
case "**/*.*":
|
| 855 |
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
| 856 |
+
case "**/.*":
|
| 857 |
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
| 858 |
+
default: {
|
| 859 |
+
let match = /^(.*?)\.(\w+)$/.exec(str);
|
| 860 |
+
if (!match) return;
|
| 861 |
+
let source2 = create(match[1]);
|
| 862 |
+
return source2 ? source2 + DOT_LITERAL + match[2] : void 0;
|
| 863 |
+
}
|
| 864 |
+
}
|
| 865 |
+
}, output = utils.removePrefix(input, state), source = create(output);
|
| 866 |
+
return source && opts.strictSlashes !== !0 && (source += `${SLASH_LITERAL}?`), source;
|
| 867 |
+
};
|
| 868 |
+
module.exports = parse;
|
| 869 |
+
}
|
| 870 |
+
});
|
| 871 |
+
|
| 872 |
+
// ../../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/picomatch.js
|
| 873 |
+
var require_picomatch = __commonJS({
|
| 874 |
+
"../../../node_modules/@rollup/pluginutils/node_modules/picomatch/lib/picomatch.js"(exports, module) {
|
| 875 |
+
"use strict";
|
| 876 |
+
var scan = require_scan(), parse = require_parse(), utils = require_utils(), constants = require_constants(), isObject = (val) => val && typeof val == "object" && !Array.isArray(val), picomatch = (glob, options, returnState = !1) => {
|
| 877 |
+
if (Array.isArray(glob)) {
|
| 878 |
+
let fns = glob.map((input) => picomatch(input, options, returnState));
|
| 879 |
+
return (str) => {
|
| 880 |
+
for (let isMatch of fns) {
|
| 881 |
+
let state2 = isMatch(str);
|
| 882 |
+
if (state2) return state2;
|
| 883 |
+
}
|
| 884 |
+
return !1;
|
| 885 |
+
};
|
| 886 |
+
}
|
| 887 |
+
let isState = isObject(glob) && glob.tokens && glob.input;
|
| 888 |
+
if (glob === "" || typeof glob != "string" && !isState)
|
| 889 |
+
throw new TypeError("Expected pattern to be a non-empty string");
|
| 890 |
+
let opts = options || {}, posix2 = opts.windows, regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, !1, !0), state = regex.state;
|
| 891 |
+
delete regex.state;
|
| 892 |
+
let isIgnored = () => !1;
|
| 893 |
+
if (opts.ignore) {
|
| 894 |
+
let ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
| 895 |
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
| 896 |
+
}
|
| 897 |
+
let matcher = (input, returnObject = !1) => {
|
| 898 |
+
let { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix: posix2 }), result = { glob, state, regex, posix: posix2, input, output, match, isMatch };
|
| 899 |
+
return typeof opts.onResult == "function" && opts.onResult(result), isMatch === !1 ? (result.isMatch = !1, returnObject ? result : !1) : isIgnored(input) ? (typeof opts.onIgnore == "function" && opts.onIgnore(result), result.isMatch = !1, returnObject ? result : !1) : (typeof opts.onMatch == "function" && opts.onMatch(result), returnObject ? result : !0);
|
| 900 |
+
};
|
| 901 |
+
return returnState && (matcher.state = state), matcher;
|
| 902 |
+
};
|
| 903 |
+
picomatch.test = (input, regex, options, { glob, posix: posix2 } = {}) => {
|
| 904 |
+
if (typeof input != "string")
|
| 905 |
+
throw new TypeError("Expected input to be a string");
|
| 906 |
+
if (input === "")
|
| 907 |
+
return { isMatch: !1, output: "" };
|
| 908 |
+
let opts = options || {}, format = opts.format || (posix2 ? utils.toPosixSlashes : null), match = input === glob, output = match && format ? format(input) : input;
|
| 909 |
+
return match === !1 && (output = format ? format(input) : input, match = output === glob), (match === !1 || opts.capture === !0) && (opts.matchBase === !0 || opts.basename === !0 ? match = picomatch.matchBase(input, regex, options, posix2) : match = regex.exec(output)), { isMatch: !!match, match, output };
|
| 910 |
+
};
|
| 911 |
+
picomatch.matchBase = (input, glob, options) => (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input));
|
| 912 |
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
| 913 |
+
picomatch.parse = (pattern, options) => Array.isArray(pattern) ? pattern.map((p) => picomatch.parse(p, options)) : parse(pattern, { ...options, fastpaths: !1 });
|
| 914 |
+
picomatch.scan = (input, options) => scan(input, options);
|
| 915 |
+
picomatch.compileRe = (state, options, returnOutput = !1, returnState = !1) => {
|
| 916 |
+
if (returnOutput === !0)
|
| 917 |
+
return state.output;
|
| 918 |
+
let opts = options || {}, prepend = opts.contains ? "" : "^", append = opts.contains ? "" : "$", source = `${prepend}(?:${state.output})${append}`;
|
| 919 |
+
state && state.negated === !0 && (source = `^(?!${source}).*$`);
|
| 920 |
+
let regex = picomatch.toRegex(source, options);
|
| 921 |
+
return returnState === !0 && (regex.state = state), regex;
|
| 922 |
+
};
|
| 923 |
+
picomatch.makeRe = (input, options = {}, returnOutput = !1, returnState = !1) => {
|
| 924 |
+
if (!input || typeof input != "string")
|
| 925 |
+
throw new TypeError("Expected a non-empty string");
|
| 926 |
+
let parsed = { negated: !1, fastpaths: !0 };
|
| 927 |
+
return options.fastpaths !== !1 && (input[0] === "." || input[0] === "*") && (parsed.output = parse.fastpaths(input, options)), parsed.output || (parsed = parse(input, options)), picomatch.compileRe(parsed, options, returnOutput, returnState);
|
| 928 |
+
};
|
| 929 |
+
picomatch.toRegex = (source, options) => {
|
| 930 |
+
try {
|
| 931 |
+
let opts = options || {};
|
| 932 |
+
return new RegExp(source, opts.flags || (opts.nocase ? "i" : ""));
|
| 933 |
+
} catch (err) {
|
| 934 |
+
if (options && options.debug === !0) throw err;
|
| 935 |
+
return /$^/;
|
| 936 |
+
}
|
| 937 |
+
};
|
| 938 |
+
picomatch.constants = constants;
|
| 939 |
+
module.exports = picomatch;
|
| 940 |
+
}
|
| 941 |
+
});
|
| 942 |
+
|
| 943 |
+
// ../../../node_modules/@rollup/pluginutils/node_modules/picomatch/index.js
|
| 944 |
+
var require_picomatch2 = __commonJS({
|
| 945 |
+
"../../../node_modules/@rollup/pluginutils/node_modules/picomatch/index.js"(exports, module) {
|
| 946 |
+
"use strict";
|
| 947 |
+
var pico = require_picomatch(), utils = require_utils();
|
| 948 |
+
function picomatch(glob, options, returnState = !1) {
|
| 949 |
+
return options && (options.windows === null || options.windows === void 0) && (options = { ...options, windows: utils.isWindows() }), pico(glob, options, returnState);
|
| 950 |
+
}
|
| 951 |
+
Object.assign(picomatch, pico);
|
| 952 |
+
module.exports = picomatch;
|
| 953 |
+
}
|
| 954 |
+
});
|
| 955 |
+
|
| 956 |
+
// ../../../node_modules/@rollup/pluginutils/dist/es/index.js
|
| 957 |
+
import { extname, win32, posix, isAbsolute, resolve } from "path";
|
| 958 |
+
var import_picomatch = __toESM(require_picomatch2(), 1);
|
| 959 |
+
function isArray(arg) {
|
| 960 |
+
return Array.isArray(arg);
|
| 961 |
+
}
|
| 962 |
+
function ensureArray(thing) {
|
| 963 |
+
return isArray(thing) ? thing : thing == null ? [] : [thing];
|
| 964 |
+
}
|
| 965 |
+
var normalizePathRegExp = new RegExp(`\\${win32.sep}`, "g"), normalizePath = function(filename) {
|
| 966 |
+
return filename.replace(normalizePathRegExp, posix.sep);
|
| 967 |
+
};
|
| 968 |
+
function getMatcherString(id, resolutionBase) {
|
| 969 |
+
if (resolutionBase === !1 || isAbsolute(id) || id.startsWith("**"))
|
| 970 |
+
return normalizePath(id);
|
| 971 |
+
let basePath = normalizePath(resolve(resolutionBase || "")).replace(/[-^$*+?.()|[\]{}]/g, "\\$&");
|
| 972 |
+
return posix.join(basePath, normalizePath(id));
|
| 973 |
+
}
|
| 974 |
+
var createFilter = function(include, exclude, options) {
|
| 975 |
+
let resolutionBase = options && options.resolve, getMatcher = (id) => id instanceof RegExp ? id : {
|
| 976 |
+
test: (what) => {
|
| 977 |
+
let pattern = getMatcherString(id, resolutionBase);
|
| 978 |
+
return (0, import_picomatch.default)(pattern, { dot: !0 })(what);
|
| 979 |
+
}
|
| 980 |
+
}, includeMatchers = ensureArray(include).map(getMatcher), excludeMatchers = ensureArray(exclude).map(getMatcher);
|
| 981 |
+
return !includeMatchers.length && !excludeMatchers.length ? (id) => typeof id == "string" && !id.includes("\0") : function(id) {
|
| 982 |
+
if (typeof id != "string" || id.includes("\0"))
|
| 983 |
+
return !1;
|
| 984 |
+
let pathId = normalizePath(id);
|
| 985 |
+
for (let i = 0; i < excludeMatchers.length; ++i) {
|
| 986 |
+
let matcher = excludeMatchers[i];
|
| 987 |
+
if (matcher instanceof RegExp && (matcher.lastIndex = 0), matcher.test(pathId))
|
| 988 |
+
return !1;
|
| 989 |
+
}
|
| 990 |
+
for (let i = 0; i < includeMatchers.length; ++i) {
|
| 991 |
+
let matcher = includeMatchers[i];
|
| 992 |
+
if (matcher instanceof RegExp && (matcher.lastIndex = 0), matcher.test(pathId))
|
| 993 |
+
return !0;
|
| 994 |
+
}
|
| 995 |
+
return !includeMatchers.length;
|
| 996 |
+
};
|
| 997 |
+
}, reservedWords = "break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public", builtins = "arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl", forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(" "));
|
| 998 |
+
forbiddenIdentifiers.add("");
|
| 999 |
+
var hasStringIsWellFormed = "isWellFormed" in String.prototype;
|
| 1000 |
+
|
| 1001 |
+
// src/mdx-plugin.ts
|
| 1002 |
+
async function mdxPlugin(options) {
|
| 1003 |
+
let filter = createFilter(/\.mdx$/), { presets } = options, mdxPluginOptions = (await presets.apply("options", {}))?.mdxPluginOptions, rehypeSlug = (await import("./rehype-slug-QMVSHJMP.js")).default, rehypeExternalLinks = (await import("./rehype-external-links-B457SAPO.js")).default;
|
| 1004 |
+
return {
|
| 1005 |
+
name: "storybook:mdx-plugin",
|
| 1006 |
+
enforce: "pre",
|
| 1007 |
+
async transform(src, id) {
|
| 1008 |
+
if (!filter(id))
|
| 1009 |
+
return;
|
| 1010 |
+
let mdxLoaderOptions = await presets.apply("mdxLoaderOptions", {
|
| 1011 |
+
...mdxPluginOptions,
|
| 1012 |
+
mdxCompileOptions: {
|
| 1013 |
+
providerImportSource: import.meta.resolve("@storybook/addon-docs/mdx-react-shim"),
|
| 1014 |
+
...mdxPluginOptions?.mdxCompileOptions,
|
| 1015 |
+
rehypePlugins: [
|
| 1016 |
+
...mdxPluginOptions?.mdxCompileOptions?.rehypePlugins ?? [],
|
| 1017 |
+
rehypeSlug,
|
| 1018 |
+
rehypeExternalLinks
|
| 1019 |
+
]
|
| 1020 |
+
}
|
| 1021 |
+
});
|
| 1022 |
+
return {
|
| 1023 |
+
code: String(await compile(src, mdxLoaderOptions)),
|
| 1024 |
+
// TODO: support source maps
|
| 1025 |
+
map: null
|
| 1026 |
+
};
|
| 1027 |
+
}
|
| 1028 |
+
};
|
| 1029 |
+
}
|
| 1030 |
+
export {
|
| 1031 |
+
mdxPlugin
|
| 1032 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/rehype-external-links-B457SAPO.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import CJS_COMPAT_NODE_URL_t17piavj1z from 'node:url';
|
| 2 |
+
import CJS_COMPAT_NODE_PATH_t17piavj1z from 'node:path';
|
| 3 |
+
import CJS_COMPAT_NODE_MODULE_t17piavj1z from "node:module";
|
| 4 |
+
|
| 5 |
+
var __filename = CJS_COMPAT_NODE_URL_t17piavj1z.fileURLToPath(import.meta.url);
|
| 6 |
+
var __dirname = CJS_COMPAT_NODE_PATH_t17piavj1z.dirname(__filename);
|
| 7 |
+
var require = CJS_COMPAT_NODE_MODULE_t17piavj1z.createRequire(import.meta.url);
|
| 8 |
+
|
| 9 |
+
// ------------------------------------------------------------
|
| 10 |
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
| 11 |
+
// ------------------------------------------------------------
|
| 12 |
+
import {
|
| 13 |
+
esm_default,
|
| 14 |
+
parse
|
| 15 |
+
} from "./chunk-2SCGLXP5.js";
|
| 16 |
+
import {
|
| 17 |
+
visit
|
| 18 |
+
} from "./chunk-4WYSRR6Q.js";
|
| 19 |
+
import "./chunk-G6W4HXRC.js";
|
| 20 |
+
|
| 21 |
+
// ../../../node_modules/hast-util-is-element/lib/index.js
|
| 22 |
+
var convertElement = (
|
| 23 |
+
// Note: overloads in JSDoc can’t yet use different `@template`s.
|
| 24 |
+
/**
|
| 25 |
+
* @type {(
|
| 26 |
+
* (<Condition extends TestFunction>(test: Condition) => (element: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & Predicate<Condition, Element>) &
|
| 27 |
+
* (<Condition extends string>(test: Condition) => (element: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element & {tagName: Condition}) &
|
| 28 |
+
* ((test?: null | undefined) => (element?: unknown, index?: number | null | undefined, parent?: Parents | null | undefined, context?: unknown) => element is Element) &
|
| 29 |
+
* ((test?: Test) => Check)
|
| 30 |
+
* )}
|
| 31 |
+
*/
|
| 32 |
+
/**
|
| 33 |
+
* @param {Test | null | undefined} [test]
|
| 34 |
+
* @returns {Check}
|
| 35 |
+
*/
|
| 36 |
+
(function(test) {
|
| 37 |
+
if (test == null)
|
| 38 |
+
return element;
|
| 39 |
+
if (typeof test == "string")
|
| 40 |
+
return tagNameFactory(test);
|
| 41 |
+
if (typeof test == "object")
|
| 42 |
+
return anyFactory(test);
|
| 43 |
+
if (typeof test == "function")
|
| 44 |
+
return castFactory(test);
|
| 45 |
+
throw new Error("Expected function, string, or array as `test`");
|
| 46 |
+
})
|
| 47 |
+
);
|
| 48 |
+
function anyFactory(tests) {
|
| 49 |
+
let checks = [], index = -1;
|
| 50 |
+
for (; ++index < tests.length; )
|
| 51 |
+
checks[index] = convertElement(tests[index]);
|
| 52 |
+
return castFactory(any);
|
| 53 |
+
function any(...parameters) {
|
| 54 |
+
let index2 = -1;
|
| 55 |
+
for (; ++index2 < checks.length; )
|
| 56 |
+
if (checks[index2].apply(this, parameters)) return !0;
|
| 57 |
+
return !1;
|
| 58 |
+
}
|
| 59 |
+
}
|
| 60 |
+
function tagNameFactory(check) {
|
| 61 |
+
return castFactory(tagName);
|
| 62 |
+
function tagName(element2) {
|
| 63 |
+
return element2.tagName === check;
|
| 64 |
+
}
|
| 65 |
+
}
|
| 66 |
+
function castFactory(testFunction) {
|
| 67 |
+
return check;
|
| 68 |
+
function check(value, index, parent) {
|
| 69 |
+
return !!(looksLikeAnElement(value) && testFunction.call(
|
| 70 |
+
this,
|
| 71 |
+
value,
|
| 72 |
+
typeof index == "number" ? index : void 0,
|
| 73 |
+
parent || void 0
|
| 74 |
+
));
|
| 75 |
+
}
|
| 76 |
+
}
|
| 77 |
+
function element(element2) {
|
| 78 |
+
return !!(element2 && typeof element2 == "object" && "type" in element2 && element2.type === "element" && "tagName" in element2 && typeof element2.tagName == "string");
|
| 79 |
+
}
|
| 80 |
+
function looksLikeAnElement(value) {
|
| 81 |
+
return value !== null && typeof value == "object" && "type" in value && "tagName" in value;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
// ../../../node_modules/is-absolute-url/index.js
|
| 85 |
+
var ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/, WINDOWS_PATH_REGEX = /^[a-zA-Z]:\\/;
|
| 86 |
+
function isAbsoluteUrl(url) {
|
| 87 |
+
if (typeof url != "string")
|
| 88 |
+
throw new TypeError(`Expected a \`string\`, got \`${typeof url}\``);
|
| 89 |
+
return WINDOWS_PATH_REGEX.test(url) ? !1 : ABSOLUTE_URL_REGEX.test(url);
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
// ../../../node_modules/rehype-external-links/lib/index.js
|
| 93 |
+
var defaultProtocols = ["http", "https"], defaultRel = ["nofollow"], emptyOptions = {};
|
| 94 |
+
function rehypeExternalLinks(options) {
|
| 95 |
+
let settings = options || emptyOptions, protocols = settings.protocols || defaultProtocols, is = convertElement(settings.test);
|
| 96 |
+
return function(tree) {
|
| 97 |
+
visit(tree, "element", function(node, index, parent) {
|
| 98 |
+
if (node.tagName === "a" && typeof node.properties.href == "string" && is(node, index, parent)) {
|
| 99 |
+
let url = node.properties.href;
|
| 100 |
+
if (isAbsoluteUrl(url) ? protocols.includes(url.slice(0, url.indexOf(":"))) : url.startsWith("//")) {
|
| 101 |
+
let contentRaw = createIfNeeded(settings.content, node), content = contentRaw && !Array.isArray(contentRaw) ? [contentRaw] : contentRaw, relRaw = createIfNeeded(settings.rel, node) || defaultRel, rel = typeof relRaw == "string" ? parse(relRaw) : relRaw, target = createIfNeeded(settings.target, node), properties = createIfNeeded(settings.properties, node);
|
| 102 |
+
if (properties && Object.assign(node.properties, esm_default(properties)), rel.length > 0 && (node.properties.rel = [...rel]), target && (node.properties.target = target), content) {
|
| 103 |
+
let properties2 = createIfNeeded(settings.contentProperties, node) || {};
|
| 104 |
+
node.children.push({
|
| 105 |
+
type: "element",
|
| 106 |
+
tagName: "span",
|
| 107 |
+
properties: esm_default(properties2),
|
| 108 |
+
children: esm_default(content)
|
| 109 |
+
});
|
| 110 |
+
}
|
| 111 |
+
}
|
| 112 |
+
}
|
| 113 |
+
});
|
| 114 |
+
};
|
| 115 |
+
}
|
| 116 |
+
function createIfNeeded(value, element2) {
|
| 117 |
+
return typeof value == "function" ? value(element2) : value;
|
| 118 |
+
}
|
| 119 |
+
export {
|
| 120 |
+
rehypeExternalLinks as default
|
| 121 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/_node-chunks/rehype-slug-QMVSHJMP.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import CJS_COMPAT_NODE_URL_t17piavj1z from 'node:url';
|
| 2 |
+
import CJS_COMPAT_NODE_PATH_t17piavj1z from 'node:path';
|
| 3 |
+
import CJS_COMPAT_NODE_MODULE_t17piavj1z from "node:module";
|
| 4 |
+
|
| 5 |
+
var __filename = CJS_COMPAT_NODE_URL_t17piavj1z.fileURLToPath(import.meta.url);
|
| 6 |
+
var __dirname = CJS_COMPAT_NODE_PATH_t17piavj1z.dirname(__filename);
|
| 7 |
+
var require = CJS_COMPAT_NODE_MODULE_t17piavj1z.createRequire(import.meta.url);
|
| 8 |
+
|
| 9 |
+
// ------------------------------------------------------------
|
| 10 |
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
| 11 |
+
// ------------------------------------------------------------
|
| 12 |
+
import {
|
| 13 |
+
visit
|
| 14 |
+
} from "./chunk-4WYSRR6Q.js";
|
| 15 |
+
import "./chunk-G6W4HXRC.js";
|
| 16 |
+
|
| 17 |
+
// ../../../node_modules/github-slugger/regex.js
|
| 18 |
+
var regex = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0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u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uD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DE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;
|
| 19 |
+
|
| 20 |
+
// ../../../node_modules/github-slugger/index.js
|
| 21 |
+
var own = Object.hasOwnProperty, BananaSlug = class {
|
| 22 |
+
/**
|
| 23 |
+
* Create a new slug class.
|
| 24 |
+
*/
|
| 25 |
+
constructor() {
|
| 26 |
+
this.occurrences, this.reset();
|
| 27 |
+
}
|
| 28 |
+
/**
|
| 29 |
+
* Generate a unique slug.
|
| 30 |
+
*
|
| 31 |
+
* Tracks previously generated slugs: repeated calls with the same value
|
| 32 |
+
* will result in different slugs.
|
| 33 |
+
* Use the `slug` function to get same slugs.
|
| 34 |
+
*
|
| 35 |
+
* @param {string} value
|
| 36 |
+
* String of text to slugify
|
| 37 |
+
* @param {boolean} [maintainCase=false]
|
| 38 |
+
* Keep the current case, otherwise make all lowercase
|
| 39 |
+
* @return {string}
|
| 40 |
+
* A unique slug string
|
| 41 |
+
*/
|
| 42 |
+
slug(value, maintainCase) {
|
| 43 |
+
let self = this, result = slug(value, maintainCase === !0), originalSlug = result;
|
| 44 |
+
for (; own.call(self.occurrences, result); )
|
| 45 |
+
self.occurrences[originalSlug]++, result = originalSlug + "-" + self.occurrences[originalSlug];
|
| 46 |
+
return self.occurrences[result] = 0, result;
|
| 47 |
+
}
|
| 48 |
+
/**
|
| 49 |
+
* Reset - Forget all previous slugs
|
| 50 |
+
*
|
| 51 |
+
* @return void
|
| 52 |
+
*/
|
| 53 |
+
reset() {
|
| 54 |
+
this.occurrences = /* @__PURE__ */ Object.create(null);
|
| 55 |
+
}
|
| 56 |
+
};
|
| 57 |
+
function slug(value, maintainCase) {
|
| 58 |
+
return typeof value != "string" ? "" : (maintainCase || (value = value.toLowerCase()), value.replace(regex, "").replace(/ /g, "-"));
|
| 59 |
+
}
|
| 60 |
+
|
| 61 |
+
// ../../../node_modules/hast-util-heading-rank/lib/index.js
|
| 62 |
+
function headingRank(node) {
|
| 63 |
+
let name = node.type === "element" ? node.tagName.toLowerCase() : "", code = name.length === 2 && name.charCodeAt(0) === 104 ? name.charCodeAt(1) : 0;
|
| 64 |
+
return code > 48 && code < 55 ? code - 48 : void 0;
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
// ../../../node_modules/hast-util-to-string/lib/index.js
|
| 68 |
+
function toString(node) {
|
| 69 |
+
return "children" in node ? all(node) : "value" in node ? node.value : "";
|
| 70 |
+
}
|
| 71 |
+
function one(node) {
|
| 72 |
+
return node.type === "text" ? node.value : "children" in node ? all(node) : "";
|
| 73 |
+
}
|
| 74 |
+
function all(node) {
|
| 75 |
+
let index = -1, result = [];
|
| 76 |
+
for (; ++index < node.children.length; )
|
| 77 |
+
result[index] = one(node.children[index]);
|
| 78 |
+
return result.join("");
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
// ../../../node_modules/rehype-slug/lib/index.js
|
| 82 |
+
var emptyOptions = {}, slugs = new BananaSlug();
|
| 83 |
+
function rehypeSlug(options) {
|
| 84 |
+
let prefix = (options || emptyOptions).prefix || "";
|
| 85 |
+
return function(tree) {
|
| 86 |
+
slugs.reset(), visit(tree, "element", function(node) {
|
| 87 |
+
headingRank(node) && !node.properties.id && (node.properties.id = prefix + slugs.slug(toString(node)));
|
| 88 |
+
});
|
| 89 |
+
};
|
| 90 |
+
}
|
| 91 |
+
export {
|
| 92 |
+
rehypeSlug as default
|
| 93 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/angular/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const setCompodocJson: (compodocJson: any) => void;
|
| 2 |
+
|
| 3 |
+
export { setCompodocJson };
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/angular/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import "../_browser-chunks/chunk-SL3VIQZ3.js";
|
| 2 |
+
|
| 3 |
+
// src/angular/index.ts
|
| 4 |
+
var setCompodocJson = (compodocJson) => {
|
| 5 |
+
globalThis.__STORYBOOK_COMPODOC_JSON__ = compodocJson;
|
| 6 |
+
};
|
| 7 |
+
export {
|
| 8 |
+
setCompodocJson
|
| 9 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/blocks.d.ts
ADDED
|
@@ -0,0 +1,1083 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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entProps, FunctionComponent, PropsWithChildren, ReactElement, Context, ReactNode } from 'react';
|
| 3 |
+
import { Conditional, PreparedStory, DocsContextProps, ModuleExports, Renderer as Renderer$1, StoryId, Args as Args$1, ModuleExport, ResolvedModuleExportType, ResolvedModuleExportFromType, Parameters as Parameters$1, ProjectAnnotations, BaseAnnotations, ComponentTitle } from 'storybook/internal/types';
|
| 4 |
+
export { DocsContextProps } from 'storybook/internal/types';
|
| 5 |
+
import { Channel } from 'storybook/internal/channels';
|
| 6 |
+
import { Renderer } from 'storybook/internal/csf';
|
| 7 |
+
import { PropDescriptor } from 'storybook/preview-api';
|
| 8 |
+
import { SupportedLanguage, SyntaxHighlighter, ActionItem, SyntaxHighlighterFormatTypes } from 'storybook/internal/components';
|
| 9 |
+
import { SourceType } from 'storybook/internal/docs-tools';
|
| 10 |
+
import { ThemeVars } from 'storybook/theming';
|
| 11 |
+
|
| 12 |
+
interface ArgType {
|
| 13 |
+
name?: string;
|
| 14 |
+
description?: string;
|
| 15 |
+
defaultValue?: any;
|
| 16 |
+
if?: Conditional;
|
| 17 |
+
table?: {
|
| 18 |
+
category?: string;
|
| 19 |
+
disable?: boolean;
|
| 20 |
+
subcategory?: string;
|
| 21 |
+
defaultValue?: {
|
| 22 |
+
summary?: string | undefined;
|
| 23 |
+
detail?: string | undefined;
|
| 24 |
+
};
|
| 25 |
+
type?: {
|
| 26 |
+
summary?: string | undefined;
|
| 27 |
+
detail?: string | undefined;
|
| 28 |
+
};
|
| 29 |
+
readonly?: boolean;
|
| 30 |
+
[key: string]: any;
|
| 31 |
+
};
|
| 32 |
+
[key: string]: any;
|
| 33 |
+
}
|
| 34 |
+
interface ArgTypes$1 {
|
| 35 |
+
[key: string]: ArgType;
|
| 36 |
+
}
|
| 37 |
+
interface Args {
|
| 38 |
+
[key: string]: any;
|
| 39 |
+
}
|
| 40 |
+
type Globals = {
|
| 41 |
+
[name: string]: any;
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
declare enum ArgsTableError {
|
| 45 |
+
NO_COMPONENT = "No component found.",
|
| 46 |
+
ARGS_UNSUPPORTED = "Args unsupported. See Args documentation for your framework."
|
| 47 |
+
}
|
| 48 |
+
type SortType = 'alpha' | 'requiredFirst' | 'none';
|
| 49 |
+
interface ArgsTableOptionProps {
|
| 50 |
+
children?: React__default.ReactNode;
|
| 51 |
+
updateArgs?: (args: Args) => void;
|
| 52 |
+
resetArgs?: (argNames?: string[]) => void;
|
| 53 |
+
compact?: boolean;
|
| 54 |
+
inAddonPanel?: boolean;
|
| 55 |
+
inTabPanel?: boolean;
|
| 56 |
+
initialExpandedArgs?: boolean;
|
| 57 |
+
isLoading?: boolean;
|
| 58 |
+
sort?: SortType;
|
| 59 |
+
}
|
| 60 |
+
interface ArgsTableDataProps {
|
| 61 |
+
rows: ArgTypes$1;
|
| 62 |
+
args?: Args;
|
| 63 |
+
globals?: Globals;
|
| 64 |
+
}
|
| 65 |
+
interface ArgsTableErrorProps {
|
| 66 |
+
error: ArgsTableError;
|
| 67 |
+
}
|
| 68 |
+
interface ArgsTableLoadingProps {
|
| 69 |
+
isLoading: boolean;
|
| 70 |
+
}
|
| 71 |
+
type ArgsTableProps = ArgsTableOptionProps & (ArgsTableDataProps | ArgsTableErrorProps | ArgsTableLoadingProps);
|
| 72 |
+
/**
|
| 73 |
+
* Display the props for a component as a props table. Each row is a collection of ArgDefs, usually
|
| 74 |
+
* derived from docgen info for the component.
|
| 75 |
+
*/
|
| 76 |
+
declare const ArgsTable: FC<ArgsTableProps>;
|
| 77 |
+
|
| 78 |
+
declare enum SourceError {
|
| 79 |
+
NO_STORY = "There\u2019s no story here.",
|
| 80 |
+
SOURCE_UNAVAILABLE = "Oh no! The source is not available."
|
| 81 |
+
}
|
| 82 |
+
interface SourceCodeProps {
|
| 83 |
+
/** The language the syntax highlighter uses for your story’s code */
|
| 84 |
+
language?: SupportedLanguage;
|
| 85 |
+
/** Use this to override the content of the source block. */
|
| 86 |
+
code?: string;
|
| 87 |
+
/** The formatter the syntax highlighter uses for your story’s code. */
|
| 88 |
+
format?: ComponentProps<typeof SyntaxHighlighter>['format'];
|
| 89 |
+
/** Display the source snippet in a dark mode. */
|
| 90 |
+
dark?: boolean;
|
| 91 |
+
}
|
| 92 |
+
interface SourceProps$1 extends SourceCodeProps {
|
| 93 |
+
isLoading?: boolean;
|
| 94 |
+
error?: SourceError;
|
| 95 |
+
}
|
| 96 |
+
/** Syntax-highlighted source code for a component (or anything!) */
|
| 97 |
+
declare const Source$1: FunctionComponent<SourceProps$1>;
|
| 98 |
+
|
| 99 |
+
type PreviewProps = PropsWithChildren<{
|
| 100 |
+
isLoading?: true;
|
| 101 |
+
layout?: Layout;
|
| 102 |
+
inline?: boolean;
|
| 103 |
+
isColumn?: boolean;
|
| 104 |
+
columns?: number;
|
| 105 |
+
withSource?: SourceProps$1;
|
| 106 |
+
isExpanded?: boolean;
|
| 107 |
+
withToolbar?: boolean;
|
| 108 |
+
className?: string;
|
| 109 |
+
additionalActions?: ActionItem[];
|
| 110 |
+
}>;
|
| 111 |
+
type Layout = 'padded' | 'fullscreen' | 'centered';
|
| 112 |
+
|
| 113 |
+
interface CommonProps {
|
| 114 |
+
story: PreparedStory;
|
| 115 |
+
inline: boolean;
|
| 116 |
+
primary: boolean;
|
| 117 |
+
}
|
| 118 |
+
interface InlineStoryProps extends CommonProps {
|
| 119 |
+
inline: true;
|
| 120 |
+
height?: string;
|
| 121 |
+
autoplay: boolean;
|
| 122 |
+
forceInitialArgs: boolean;
|
| 123 |
+
renderStoryToElement: DocsContextProps['renderStoryToElement'];
|
| 124 |
+
}
|
| 125 |
+
interface IFrameStoryProps extends CommonProps {
|
| 126 |
+
inline: false;
|
| 127 |
+
height: string;
|
| 128 |
+
}
|
| 129 |
+
type StoryProps$1 = InlineStoryProps | IFrameStoryProps;
|
| 130 |
+
declare const Story$1: FunctionComponent<StoryProps$1>;
|
| 131 |
+
|
| 132 |
+
interface TypesetProps {
|
| 133 |
+
fontFamily?: string;
|
| 134 |
+
fontSizes: (string | number)[];
|
| 135 |
+
fontWeight?: number;
|
| 136 |
+
sampleText?: string;
|
| 137 |
+
}
|
| 138 |
+
/**
|
| 139 |
+
* Convenient styleguide documentation showing examples of type with different sizes and weights and
|
| 140 |
+
* configurable sample text.
|
| 141 |
+
*/
|
| 142 |
+
declare const Typeset: FC<TypesetProps>;
|
| 143 |
+
|
| 144 |
+
type Colors = string[] | {
|
| 145 |
+
[key: string]: string;
|
| 146 |
+
};
|
| 147 |
+
interface ColorItemProps {
|
| 148 |
+
title: string;
|
| 149 |
+
subtitle: string;
|
| 150 |
+
colors: Colors;
|
| 151 |
+
}
|
| 152 |
+
/**
|
| 153 |
+
* A single color row your styleguide showing title, subtitle and one or more colors, used as a
|
| 154 |
+
* child of `ColorPalette`.
|
| 155 |
+
*/
|
| 156 |
+
declare const ColorItem: FunctionComponent<ColorItemProps>;
|
| 157 |
+
interface ColorPaletteProps {
|
| 158 |
+
children?: React__default.ReactNode;
|
| 159 |
+
}
|
| 160 |
+
/**
|
| 161 |
+
* Styleguide documentation for colors, including names, captions, and color swatches, all specified
|
| 162 |
+
* as `ColorItem` children of this wrapper component.
|
| 163 |
+
*/
|
| 164 |
+
declare const ColorPalette: FunctionComponent<ColorPaletteProps>;
|
| 165 |
+
|
| 166 |
+
interface IconItemProps {
|
| 167 |
+
name: string;
|
| 168 |
+
children?: React__default.ReactNode;
|
| 169 |
+
}
|
| 170 |
+
/** An individual icon with a caption and an example (passed as `children`). */
|
| 171 |
+
declare const IconItem: FunctionComponent<IconItemProps>;
|
| 172 |
+
interface IconGalleryProps {
|
| 173 |
+
children?: React__default.ReactNode;
|
| 174 |
+
}
|
| 175 |
+
/** Show a grid of icons, as specified by `IconItem`. */
|
| 176 |
+
declare const IconGallery: FunctionComponent<IconGalleryProps>;
|
| 177 |
+
|
| 178 |
+
interface TocbotOptions {
|
| 179 |
+
tocSelector: string;
|
| 180 |
+
contentSelector: string;
|
| 181 |
+
headingSelector: string;
|
| 182 |
+
ignoreSelector?: string;
|
| 183 |
+
headingsOffset?: number;
|
| 184 |
+
scrollSmoothOffset?: number;
|
| 185 |
+
orderedList?: boolean;
|
| 186 |
+
onClick?: (e: MouseEvent) => void;
|
| 187 |
+
scrollEndCallback?: () => void;
|
| 188 |
+
[key: string]: unknown;
|
| 189 |
+
}
|
| 190 |
+
interface TocParameters {
|
| 191 |
+
/** CSS selector for the container to search for headings. */
|
| 192 |
+
contentsSelector?: string;
|
| 193 |
+
/**
|
| 194 |
+
* When true, hide the TOC. We still show the empty container (as opposed to showing nothing at
|
| 195 |
+
* all) because it affects the page layout and we want to preserve the layout across pages.
|
| 196 |
+
*/
|
| 197 |
+
disable?: boolean;
|
| 198 |
+
/** CSS selector to match headings to list in the TOC. */
|
| 199 |
+
headingSelector?: string;
|
| 200 |
+
/** Headings that match the ignoreSelector will be skipped. */
|
| 201 |
+
ignoreSelector?: string;
|
| 202 |
+
/** Custom title ReactElement or string to display above the TOC. */
|
| 203 |
+
title?: ReactElement | string | null;
|
| 204 |
+
/**
|
| 205 |
+
* TocBot options, not guaranteed to be available in future versions.
|
| 206 |
+
*
|
| 207 |
+
* @see tocbot docs {@link https://tscanlin.github.io/tocbot/#usage}
|
| 208 |
+
*/
|
| 209 |
+
unsafeTocbotOptions?: Omit<TocbotOptions, 'onClick' | 'scrollEndCallback'>;
|
| 210 |
+
}
|
| 211 |
+
type TableOfContentsProps = React__default.PropsWithChildren<TocParameters & {
|
| 212 |
+
className?: string;
|
| 213 |
+
channel: Channel;
|
| 214 |
+
}>;
|
| 215 |
+
declare const TableOfContents: ({ title, disable, headingSelector, contentsSelector, ignoreSelector, unsafeTocbotOptions, channel, className, }: TableOfContentsProps) => React__default.JSX.Element;
|
| 216 |
+
|
| 217 |
+
declare const anchorBlockIdFromId: (storyId: string) => string;
|
| 218 |
+
interface AnchorProps {
|
| 219 |
+
storyId: string;
|
| 220 |
+
}
|
| 221 |
+
declare const Anchor: FC<PropsWithChildren<AnchorProps>>;
|
| 222 |
+
|
| 223 |
+
type ArgTypesParameters = {
|
| 224 |
+
include?: PropDescriptor;
|
| 225 |
+
exclude?: PropDescriptor;
|
| 226 |
+
sort?: SortType;
|
| 227 |
+
};
|
| 228 |
+
type ArgTypesProps = ArgTypesParameters & {
|
| 229 |
+
of?: Renderer['component'] | ModuleExports;
|
| 230 |
+
};
|
| 231 |
+
declare const ArgTypes: FC<ArgTypesProps>;
|
| 232 |
+
|
| 233 |
+
declare const DocsContext: Context<DocsContextProps<Renderer$1>>;
|
| 234 |
+
|
| 235 |
+
type ArgsHash = string;
|
| 236 |
+
declare function argsHash(args: Args$1): ArgsHash;
|
| 237 |
+
interface SourceItem {
|
| 238 |
+
code: string;
|
| 239 |
+
format?: SyntaxHighlighterFormatTypes;
|
| 240 |
+
}
|
| 241 |
+
type StorySources = Record<StoryId, Record<ArgsHash, SourceItem>>;
|
| 242 |
+
interface SourceContextProps {
|
| 243 |
+
sources: StorySources;
|
| 244 |
+
setSource?: (id: StoryId, item: SourceItem) => void;
|
| 245 |
+
}
|
| 246 |
+
declare const SourceContext: Context<SourceContextProps>;
|
| 247 |
+
declare const UNKNOWN_ARGS_HASH = "--unknown--";
|
| 248 |
+
declare const SourceContainer: FC<PropsWithChildren<{
|
| 249 |
+
channel: DocsContextProps['channel'];
|
| 250 |
+
}>>;
|
| 251 |
+
|
| 252 |
+
type SourceParameters = SourceCodeProps & {
|
| 253 |
+
/** Where to read the source code from, see `SourceType` */
|
| 254 |
+
type?: SourceType;
|
| 255 |
+
/** Transform the detected source for display */
|
| 256 |
+
transform?: (code: string, storyContext: ReturnType<DocsContextProps['getStoryContext']>) => string | Promise<string>;
|
| 257 |
+
/** Internal: set by our CSF loader (`enrichCsf` in `storybook/internal/csf-tools`). */
|
| 258 |
+
originalSource?: string;
|
| 259 |
+
};
|
| 260 |
+
type SourceProps = SourceParameters & {
|
| 261 |
+
/**
|
| 262 |
+
* Pass the export defining a story to render its source
|
| 263 |
+
*
|
| 264 |
+
* ```jsx
|
| 265 |
+
* import { Source } from '@storybook/addon-docs/blocks';
|
| 266 |
+
* import * as ButtonStories from './Button.stories';
|
| 267 |
+
*
|
| 268 |
+
* <Source of={ButtonStories.Primary} />;
|
| 269 |
+
* ```
|
| 270 |
+
*/
|
| 271 |
+
of?: ModuleExport;
|
| 272 |
+
/** Internal prop to control if a story re-renders on args updates */
|
| 273 |
+
__forceInitialArgs?: boolean;
|
| 274 |
+
};
|
| 275 |
+
type PureSourceProps = ComponentProps<typeof Source$1>;
|
| 276 |
+
declare const useSourceProps: (props: SourceProps, docsContext: DocsContextProps<any>, sourceContext: SourceContextProps) => PureSourceProps;
|
| 277 |
+
/**
|
| 278 |
+
* Story source doc block renders source code if provided, or the source for a story if `storyId` is
|
| 279 |
+
* provided, or the source for the current story if nothing is provided.
|
| 280 |
+
*/
|
| 281 |
+
declare const Source: (props: SourceProps) => React__default.JSX.Element;
|
| 282 |
+
|
| 283 |
+
type PureStoryProps = ComponentProps<typeof Story$1>;
|
| 284 |
+
/** Props to reference another story */
|
| 285 |
+
type StoryRefProps = {
|
| 286 |
+
/**
|
| 287 |
+
* Pass the export defining a story to render that story
|
| 288 |
+
*
|
| 289 |
+
* ```jsx
|
| 290 |
+
* import { Meta, Story } from '@storybook/addon-docs/blocks';
|
| 291 |
+
* import * as ButtonStories from './Button.stories';
|
| 292 |
+
*
|
| 293 |
+
* <Meta of={ButtonStories} />
|
| 294 |
+
* <Story of={ButtonStories.Primary} />
|
| 295 |
+
* ```
|
| 296 |
+
*/
|
| 297 |
+
of?: ModuleExport;
|
| 298 |
+
/**
|
| 299 |
+
* Pass all exports of the CSF file if this MDX file is unattached
|
| 300 |
+
*
|
| 301 |
+
* ```jsx
|
| 302 |
+
* import { Story } from '@storybook/addon-docs/blocks';
|
| 303 |
+
* import * as ButtonStories from './Button.stories';
|
| 304 |
+
*
|
| 305 |
+
* <Story of={ButtonStories.Primary} meta={ButtonStories} />;
|
| 306 |
+
* ```
|
| 307 |
+
*/
|
| 308 |
+
meta?: ModuleExports;
|
| 309 |
+
};
|
| 310 |
+
type StoryParameters = {
|
| 311 |
+
/** Render the story inline or in an iframe */
|
| 312 |
+
inline?: boolean;
|
| 313 |
+
/** When rendering in an iframe (`inline={false}`), set the story height */
|
| 314 |
+
height?: string;
|
| 315 |
+
/** Whether to run the story's play function */
|
| 316 |
+
autoplay?: boolean;
|
| 317 |
+
/** Internal prop to control if a story re-renders on args updates */
|
| 318 |
+
__forceInitialArgs?: boolean;
|
| 319 |
+
/** Internal prop if this story is the primary story */
|
| 320 |
+
__primary?: boolean;
|
| 321 |
+
};
|
| 322 |
+
type StoryProps = StoryRefProps & StoryParameters;
|
| 323 |
+
declare const getStoryId: (props: StoryProps, context: DocsContextProps) => StoryId;
|
| 324 |
+
declare const getStoryProps: <TFramework extends Renderer$1>(props: StoryParameters, story: PreparedStory<TFramework>, context: DocsContextProps<TFramework>) => PureStoryProps;
|
| 325 |
+
declare const Story: FC<StoryProps>;
|
| 326 |
+
|
| 327 |
+
type CanvasProps = Pick<PreviewProps, 'withToolbar' | 'additionalActions' | 'className'> & {
|
| 328 |
+
/**
|
| 329 |
+
* Pass the export defining a story to render that story
|
| 330 |
+
*
|
| 331 |
+
* ```jsx
|
| 332 |
+
* import { Meta, Canvas } from '@storybook/addon-docs/blocks';
|
| 333 |
+
* import * as ButtonStories from './Button.stories';
|
| 334 |
+
*
|
| 335 |
+
* <Meta of={ButtonStories} />
|
| 336 |
+
* <Canvas of={ButtonStories.Primary} />
|
| 337 |
+
* ```
|
| 338 |
+
*/
|
| 339 |
+
of?: ModuleExport;
|
| 340 |
+
/**
|
| 341 |
+
* Pass all exports of the CSF file if this MDX file is unattached
|
| 342 |
+
*
|
| 343 |
+
* ```jsx
|
| 344 |
+
* import { Canvas } from '@storybook/addon-docs/blocks';
|
| 345 |
+
* import * as ButtonStories from './Button.stories';
|
| 346 |
+
*
|
| 347 |
+
* <Canvas of={ButtonStories.Primary} meta={ButtonStories} />;
|
| 348 |
+
* ```
|
| 349 |
+
*/
|
| 350 |
+
meta?: ModuleExports;
|
| 351 |
+
/**
|
| 352 |
+
* Specify the initial state of the source panel hidden: the source panel is hidden by default
|
| 353 |
+
* shown: the source panel is shown by default none: the source panel is not available and the
|
| 354 |
+
* button to show it is hidden
|
| 355 |
+
*
|
| 356 |
+
* @default 'hidden'
|
| 357 |
+
*/
|
| 358 |
+
sourceState?: 'hidden' | 'shown' | 'none';
|
| 359 |
+
/**
|
| 360 |
+
* How to layout the story within the canvas padded: the story has padding within the canvas
|
| 361 |
+
* fullscreen: the story is rendered edge to edge within the canvas centered: the story is
|
| 362 |
+
* centered within the canvas
|
| 363 |
+
*
|
| 364 |
+
* @default 'padded'
|
| 365 |
+
*/
|
| 366 |
+
layout?: Layout;
|
| 367 |
+
/** @see {SourceProps} */
|
| 368 |
+
source?: Omit<SourceProps, 'dark'>;
|
| 369 |
+
/** @see {StoryProps} */
|
| 370 |
+
story?: Pick<StoryProps, 'inline' | 'height' | 'autoplay' | '__forceInitialArgs' | '__primary'>;
|
| 371 |
+
};
|
| 372 |
+
declare const Canvas: FC<CanvasProps>;
|
| 373 |
+
|
| 374 |
+
type ControlsParameters = {
|
| 375 |
+
include?: PropDescriptor;
|
| 376 |
+
exclude?: PropDescriptor;
|
| 377 |
+
sort?: SortType;
|
| 378 |
+
};
|
| 379 |
+
type ControlsProps = ControlsParameters & {
|
| 380 |
+
of?: Renderer['component'] | ModuleExports;
|
| 381 |
+
};
|
| 382 |
+
declare const Controls: FC<ControlsProps>;
|
| 383 |
+
|
| 384 |
+
type Of = Parameters<DocsContextProps['resolveOf']>[0];
|
| 385 |
+
/**
|
| 386 |
+
* A hook to resolve the `of` prop passed to a block. will return the resolved module if the
|
| 387 |
+
* resolved module is a meta it will include a preparedMeta property similar to a preparedStory if
|
| 388 |
+
* the resolved module is a component it will include the project annotations
|
| 389 |
+
*/
|
| 390 |
+
declare const useOf: <TType extends ResolvedModuleExportType>(moduleExportOrType: Of, validTypes?: TType[]) => ResolvedModuleExportFromType<TType>;
|
| 391 |
+
|
| 392 |
+
declare enum DescriptionType {
|
| 393 |
+
INFO = "info",
|
| 394 |
+
NOTES = "notes",
|
| 395 |
+
DOCGEN = "docgen",
|
| 396 |
+
AUTO = "auto"
|
| 397 |
+
}
|
| 398 |
+
interface DescriptionProps {
|
| 399 |
+
/**
|
| 400 |
+
* Specify where to get the description from. Can be a component, a CSF file or a story. If not
|
| 401 |
+
* specified, the description will be extracted from the meta of the attached CSF file.
|
| 402 |
+
*/
|
| 403 |
+
of?: Of;
|
| 404 |
+
}
|
| 405 |
+
declare const DescriptionContainer: FC<DescriptionProps>;
|
| 406 |
+
|
| 407 |
+
type DocsProps<TRenderer extends Renderer$1 = Renderer$1> = {
|
| 408 |
+
docsParameter: Parameters$1;
|
| 409 |
+
context: DocsContextProps<TRenderer>;
|
| 410 |
+
};
|
| 411 |
+
declare function Docs<TRenderer extends Renderer$1 = Renderer$1>({ context, docsParameter, }: DocsProps<TRenderer>): React__default.JSX.Element;
|
| 412 |
+
|
| 413 |
+
declare const DocsPage: FC;
|
| 414 |
+
|
| 415 |
+
interface DocsContainerProps<TFramework extends Renderer$1 = Renderer$1> {
|
| 416 |
+
context: DocsContextProps<TFramework>;
|
| 417 |
+
theme?: ThemeVars;
|
| 418 |
+
}
|
| 419 |
+
declare const DocsContainer: FC<PropsWithChildren<DocsContainerProps>>;
|
| 420 |
+
|
| 421 |
+
declare const PRIMARY_STORY = "^";
|
| 422 |
+
type Component = any;
|
| 423 |
+
type DocsStoryProps = {
|
| 424 |
+
of: ModuleExport;
|
| 425 |
+
expanded?: boolean;
|
| 426 |
+
withToolbar?: boolean;
|
| 427 |
+
__forceInitialArgs?: boolean;
|
| 428 |
+
__primary?: boolean;
|
| 429 |
+
};
|
| 430 |
+
|
| 431 |
+
declare const DocsStory: FC<DocsStoryProps>;
|
| 432 |
+
|
| 433 |
+
type ExternalDocsProps<TRenderer extends Renderer$1 = Renderer$1> = {
|
| 434 |
+
projectAnnotationsList: ProjectAnnotations<TRenderer>[];
|
| 435 |
+
};
|
| 436 |
+
declare function ExternalDocs<TRenderer extends Renderer$1 = Renderer$1>({ projectAnnotationsList, children, }: PropsWithChildren<ExternalDocsProps<TRenderer>>): React__default.JSX.Element;
|
| 437 |
+
|
| 438 |
+
declare const ExternalDocsContainer: React__default.FC<React__default.PropsWithChildren<{
|
| 439 |
+
projectAnnotations: any;
|
| 440 |
+
}>>;
|
| 441 |
+
|
| 442 |
+
/**
|
| 443 |
+
* Slugger.
|
| 444 |
+
*/
|
| 445 |
+
declare class BananaSlug {
|
| 446 |
+
/** @type {Record<string, number>} */
|
| 447 |
+
occurrences: Record<string, number>;
|
| 448 |
+
/**
|
| 449 |
+
* Generate a unique slug.
|
| 450 |
+
*
|
| 451 |
+
* Tracks previously generated slugs: repeated calls with the same value
|
| 452 |
+
* will result in different slugs.
|
| 453 |
+
* Use the `slug` function to get same slugs.
|
| 454 |
+
*
|
| 455 |
+
* @param {string} value
|
| 456 |
+
* String of text to slugify
|
| 457 |
+
* @param {boolean} [maintainCase=false]
|
| 458 |
+
* Keep the current case, otherwise make all lowercase
|
| 459 |
+
* @return {string}
|
| 460 |
+
* A unique slug string
|
| 461 |
+
*/
|
| 462 |
+
slug(value: string, maintainCase?: boolean | undefined): string;
|
| 463 |
+
/**
|
| 464 |
+
* Reset - Forget all previous slugs
|
| 465 |
+
*
|
| 466 |
+
* @return void
|
| 467 |
+
*/
|
| 468 |
+
reset(): void;
|
| 469 |
+
}
|
| 470 |
+
|
| 471 |
+
interface HeadingProps {
|
| 472 |
+
disableAnchor?: boolean;
|
| 473 |
+
}
|
| 474 |
+
declare const slugs: BananaSlug;
|
| 475 |
+
declare const Heading: FC<PropsWithChildren<HeadingProps>>;
|
| 476 |
+
|
| 477 |
+
/**
|
| 478 |
+
* markdown-to-jsx is a fork of
|
| 479 |
+
* [simple-markdown v0.2.2](https://github.com/Khan/simple-markdown)
|
| 480 |
+
* from Khan Academy. Thank you Khan devs for making such an awesome
|
| 481 |
+
* and extensible parsing infra... without it, half of the
|
| 482 |
+
* optimizations here wouldn't be feasible. 🙏🏼
|
| 483 |
+
*/
|
| 484 |
+
|
| 485 |
+
/**
|
| 486 |
+
* Analogous to `node.type`. Please note that the values here may change at any time,
|
| 487 |
+
* so do not hard code against the value directly.
|
| 488 |
+
*/
|
| 489 |
+
declare const RuleType: {
|
| 490 |
+
readonly blockQuote: "0";
|
| 491 |
+
readonly breakLine: "1";
|
| 492 |
+
readonly breakThematic: "2";
|
| 493 |
+
readonly codeBlock: "3";
|
| 494 |
+
readonly codeFenced: "4";
|
| 495 |
+
readonly codeInline: "5";
|
| 496 |
+
readonly footnote: "6";
|
| 497 |
+
readonly footnoteReference: "7";
|
| 498 |
+
readonly gfmTask: "8";
|
| 499 |
+
readonly heading: "9";
|
| 500 |
+
readonly headingSetext: "10";
|
| 501 |
+
/** only available if not `disableHTMLParsing` */
|
| 502 |
+
readonly htmlBlock: "11";
|
| 503 |
+
readonly htmlComment: "12";
|
| 504 |
+
/** only available if not `disableHTMLParsing` */
|
| 505 |
+
readonly htmlSelfClosing: "13";
|
| 506 |
+
readonly image: "14";
|
| 507 |
+
readonly link: "15";
|
| 508 |
+
/** emits a `link` 'node', does not render directly */
|
| 509 |
+
readonly linkAngleBraceStyleDetector: "16";
|
| 510 |
+
/** emits a `link` 'node', does not render directly */
|
| 511 |
+
readonly linkBareUrlDetector: "17";
|
| 512 |
+
/** @deprecated merged into linkAngleBraceStyleDetector
|
| 513 |
+
*
|
| 514 |
+
* emits a `link` 'node', does not render directly */
|
| 515 |
+
readonly linkMailtoDetector: "18";
|
| 516 |
+
readonly newlineCoalescer: "19";
|
| 517 |
+
readonly orderedList: "20";
|
| 518 |
+
readonly paragraph: "21";
|
| 519 |
+
readonly ref: "22";
|
| 520 |
+
readonly refImage: "23";
|
| 521 |
+
readonly refLink: "24";
|
| 522 |
+
readonly table: "25";
|
| 523 |
+
readonly tableSeparator: "26";
|
| 524 |
+
readonly text: "27";
|
| 525 |
+
readonly textBolded: "28";
|
| 526 |
+
readonly textEmphasized: "29";
|
| 527 |
+
readonly textEscaped: "30";
|
| 528 |
+
readonly textMarked: "31";
|
| 529 |
+
readonly textStrikethroughed: "32";
|
| 530 |
+
readonly unorderedList: "33";
|
| 531 |
+
};
|
| 532 |
+
type RuleType = (typeof RuleType)[keyof typeof RuleType];
|
| 533 |
+
declare const Priority: {
|
| 534 |
+
/**
|
| 535 |
+
* anything that must scan the tree before everything else
|
| 536 |
+
*/
|
| 537 |
+
MAX: number;
|
| 538 |
+
/**
|
| 539 |
+
* scans for block-level constructs
|
| 540 |
+
*/
|
| 541 |
+
HIGH: number;
|
| 542 |
+
/**
|
| 543 |
+
* inline w/ more priority than other inline
|
| 544 |
+
*/
|
| 545 |
+
MED: number;
|
| 546 |
+
/**
|
| 547 |
+
* inline elements
|
| 548 |
+
*/
|
| 549 |
+
LOW: number;
|
| 550 |
+
/**
|
| 551 |
+
* bare text and stuff that is considered leftovers
|
| 552 |
+
*/
|
| 553 |
+
MIN: number;
|
| 554 |
+
};
|
| 555 |
+
/**
|
| 556 |
+
* A simple HOC for easy React use. Feed the markdown content as a direct child
|
| 557 |
+
* and the rest is taken care of automatically.
|
| 558 |
+
*/
|
| 559 |
+
declare const Markdown$1: React.FC<Omit<React.HTMLAttributes<Element>, 'children'> & {
|
| 560 |
+
children: string;
|
| 561 |
+
options?: MarkdownToJSX.Options;
|
| 562 |
+
}>;
|
| 563 |
+
declare namespace MarkdownToJSX {
|
| 564 |
+
/**
|
| 565 |
+
* RequireAtLeastOne<{ ... }> <- only requires at least one key
|
| 566 |
+
*/
|
| 567 |
+
type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
|
| 568 |
+
[K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
|
| 569 |
+
}[Keys];
|
| 570 |
+
export type CreateElement = typeof React.createElement;
|
| 571 |
+
export type HTMLTags = keyof React.JSX.IntrinsicElements;
|
| 572 |
+
export type State = {
|
| 573 |
+
/** true if the current content is inside anchor link grammar */
|
| 574 |
+
inAnchor?: boolean;
|
| 575 |
+
/** true if parsing in an HTML context */
|
| 576 |
+
inHTML?: boolean;
|
| 577 |
+
/** true if parsing in an inline context (subset of rules around formatting and links) */
|
| 578 |
+
inline?: boolean;
|
| 579 |
+
/** true if in a table */
|
| 580 |
+
inTable?: boolean;
|
| 581 |
+
/** use this for the `key` prop */
|
| 582 |
+
key?: React.Key;
|
| 583 |
+
/** true if in a list */
|
| 584 |
+
list?: boolean;
|
| 585 |
+
/** used for lookbacks */
|
| 586 |
+
prevCapture?: string;
|
| 587 |
+
/** true if parsing in inline context w/o links */
|
| 588 |
+
simple?: boolean;
|
| 589 |
+
};
|
| 590 |
+
export interface BlockQuoteNode {
|
| 591 |
+
alert?: string;
|
| 592 |
+
children: MarkdownToJSX.ParserResult[];
|
| 593 |
+
type: typeof RuleType.blockQuote;
|
| 594 |
+
}
|
| 595 |
+
export interface BreakLineNode {
|
| 596 |
+
type: typeof RuleType.breakLine;
|
| 597 |
+
}
|
| 598 |
+
export interface BreakThematicNode {
|
| 599 |
+
type: typeof RuleType.breakThematic;
|
| 600 |
+
}
|
| 601 |
+
export interface CodeBlockNode {
|
| 602 |
+
type: typeof RuleType.codeBlock;
|
| 603 |
+
attrs?: React.JSX.IntrinsicAttributes;
|
| 604 |
+
lang?: string;
|
| 605 |
+
text: string;
|
| 606 |
+
}
|
| 607 |
+
export interface CodeFencedNode {
|
| 608 |
+
type: typeof RuleType.codeFenced;
|
| 609 |
+
}
|
| 610 |
+
export interface CodeInlineNode {
|
| 611 |
+
type: typeof RuleType.codeInline;
|
| 612 |
+
text: string;
|
| 613 |
+
}
|
| 614 |
+
export interface FootnoteNode {
|
| 615 |
+
type: typeof RuleType.footnote;
|
| 616 |
+
}
|
| 617 |
+
export interface FootnoteReferenceNode {
|
| 618 |
+
type: typeof RuleType.footnoteReference;
|
| 619 |
+
target: string;
|
| 620 |
+
text: string;
|
| 621 |
+
}
|
| 622 |
+
export interface GFMTaskNode {
|
| 623 |
+
type: typeof RuleType.gfmTask;
|
| 624 |
+
completed: boolean;
|
| 625 |
+
}
|
| 626 |
+
export interface HeadingNode {
|
| 627 |
+
type: typeof RuleType.heading;
|
| 628 |
+
children: MarkdownToJSX.ParserResult[];
|
| 629 |
+
id: string;
|
| 630 |
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
| 631 |
+
}
|
| 632 |
+
export interface HeadingSetextNode {
|
| 633 |
+
type: typeof RuleType.headingSetext;
|
| 634 |
+
}
|
| 635 |
+
export interface HTMLCommentNode {
|
| 636 |
+
type: typeof RuleType.htmlComment;
|
| 637 |
+
}
|
| 638 |
+
export interface ImageNode {
|
| 639 |
+
type: typeof RuleType.image;
|
| 640 |
+
alt?: string;
|
| 641 |
+
target: string;
|
| 642 |
+
title?: string;
|
| 643 |
+
}
|
| 644 |
+
export interface LinkNode {
|
| 645 |
+
type: typeof RuleType.link;
|
| 646 |
+
children: MarkdownToJSX.ParserResult[];
|
| 647 |
+
target: string;
|
| 648 |
+
title?: string;
|
| 649 |
+
}
|
| 650 |
+
export interface LinkAngleBraceNode {
|
| 651 |
+
type: typeof RuleType.linkAngleBraceStyleDetector;
|
| 652 |
+
}
|
| 653 |
+
export interface LinkBareURLNode {
|
| 654 |
+
type: typeof RuleType.linkBareUrlDetector;
|
| 655 |
+
}
|
| 656 |
+
export interface LinkMailtoNode {
|
| 657 |
+
type: typeof RuleType.linkMailtoDetector;
|
| 658 |
+
}
|
| 659 |
+
export interface OrderedListNode {
|
| 660 |
+
type: typeof RuleType.orderedList;
|
| 661 |
+
items: MarkdownToJSX.ParserResult[][];
|
| 662 |
+
ordered: true;
|
| 663 |
+
start?: number;
|
| 664 |
+
}
|
| 665 |
+
export interface UnorderedListNode {
|
| 666 |
+
type: typeof RuleType.unorderedList;
|
| 667 |
+
items: MarkdownToJSX.ParserResult[][];
|
| 668 |
+
ordered: false;
|
| 669 |
+
}
|
| 670 |
+
export interface NewlineNode {
|
| 671 |
+
type: typeof RuleType.newlineCoalescer;
|
| 672 |
+
}
|
| 673 |
+
export interface ParagraphNode {
|
| 674 |
+
type: typeof RuleType.paragraph;
|
| 675 |
+
children: MarkdownToJSX.ParserResult[];
|
| 676 |
+
}
|
| 677 |
+
export interface ReferenceNode {
|
| 678 |
+
type: typeof RuleType.ref;
|
| 679 |
+
}
|
| 680 |
+
export interface ReferenceImageNode {
|
| 681 |
+
type: typeof RuleType.refImage;
|
| 682 |
+
alt?: string;
|
| 683 |
+
ref: string;
|
| 684 |
+
}
|
| 685 |
+
export interface ReferenceLinkNode {
|
| 686 |
+
type: typeof RuleType.refLink;
|
| 687 |
+
children: MarkdownToJSX.ParserResult[];
|
| 688 |
+
fallbackChildren: string;
|
| 689 |
+
ref: string;
|
| 690 |
+
}
|
| 691 |
+
export interface TableNode {
|
| 692 |
+
type: typeof RuleType.table;
|
| 693 |
+
/**
|
| 694 |
+
* alignment for each table column
|
| 695 |
+
*/
|
| 696 |
+
align: ('left' | 'right' | 'center')[];
|
| 697 |
+
cells: MarkdownToJSX.ParserResult[][][];
|
| 698 |
+
header: MarkdownToJSX.ParserResult[][];
|
| 699 |
+
}
|
| 700 |
+
export interface TableSeparatorNode {
|
| 701 |
+
type: typeof RuleType.tableSeparator;
|
| 702 |
+
}
|
| 703 |
+
export interface TextNode {
|
| 704 |
+
type: typeof RuleType.text;
|
| 705 |
+
text: string;
|
| 706 |
+
}
|
| 707 |
+
export interface BoldTextNode {
|
| 708 |
+
type: typeof RuleType.textBolded;
|
| 709 |
+
children: MarkdownToJSX.ParserResult[];
|
| 710 |
+
}
|
| 711 |
+
export interface ItalicTextNode {
|
| 712 |
+
type: typeof RuleType.textEmphasized;
|
| 713 |
+
children: MarkdownToJSX.ParserResult[];
|
| 714 |
+
}
|
| 715 |
+
export interface EscapedTextNode {
|
| 716 |
+
type: typeof RuleType.textEscaped;
|
| 717 |
+
}
|
| 718 |
+
export interface MarkedTextNode {
|
| 719 |
+
type: typeof RuleType.textMarked;
|
| 720 |
+
children: MarkdownToJSX.ParserResult[];
|
| 721 |
+
}
|
| 722 |
+
export interface StrikethroughTextNode {
|
| 723 |
+
type: typeof RuleType.textStrikethroughed;
|
| 724 |
+
children: MarkdownToJSX.ParserResult[];
|
| 725 |
+
}
|
| 726 |
+
export interface HTMLNode {
|
| 727 |
+
type: typeof RuleType.htmlBlock;
|
| 728 |
+
attrs: React.JSX.IntrinsicAttributes;
|
| 729 |
+
children?: ReturnType<MarkdownToJSX.NestedParser> | undefined;
|
| 730 |
+
noInnerParse: Boolean;
|
| 731 |
+
tag: MarkdownToJSX.HTMLTags;
|
| 732 |
+
text?: string | undefined;
|
| 733 |
+
}
|
| 734 |
+
export interface HTMLSelfClosingNode {
|
| 735 |
+
type: typeof RuleType.htmlSelfClosing;
|
| 736 |
+
attrs: React.JSX.IntrinsicAttributes;
|
| 737 |
+
tag: string;
|
| 738 |
+
}
|
| 739 |
+
export type ParserResult = BlockQuoteNode | BreakLineNode | BreakThematicNode | CodeBlockNode | CodeFencedNode | CodeInlineNode | FootnoteNode | FootnoteReferenceNode | GFMTaskNode | HeadingNode | HeadingSetextNode | HTMLCommentNode | ImageNode | LinkNode | LinkAngleBraceNode | LinkBareURLNode | LinkMailtoNode | OrderedListNode | UnorderedListNode | NewlineNode | ParagraphNode | ReferenceNode | ReferenceImageNode | ReferenceLinkNode | TableNode | TableSeparatorNode | TextNode | BoldTextNode | ItalicTextNode | EscapedTextNode | MarkedTextNode | StrikethroughTextNode | HTMLNode | HTMLSelfClosingNode;
|
| 740 |
+
export type NestedParser = (input: string, state?: MarkdownToJSX.State) => MarkdownToJSX.ParserResult[];
|
| 741 |
+
export type Parser<ParserOutput> = (capture: RegExpMatchArray, nestedParse: NestedParser, state?: MarkdownToJSX.State) => ParserOutput;
|
| 742 |
+
export type RuleOutput = (ast: MarkdownToJSX.ParserResult | MarkdownToJSX.ParserResult[], state: MarkdownToJSX.State) => React.ReactNode;
|
| 743 |
+
export type Rule<ParserOutput = MarkdownToJSX.ParserResult> = {
|
| 744 |
+
_match: (source: string, state: MarkdownToJSX.State, prevCapturedString?: string) => RegExpMatchArray;
|
| 745 |
+
_order: (typeof Priority)[keyof typeof Priority];
|
| 746 |
+
_parse: MarkdownToJSX.Parser<Omit<ParserOutput, 'type'>>;
|
| 747 |
+
/**
|
| 748 |
+
* Optional fast check that can quickly determine if this rule
|
| 749 |
+
* should even be attempted. Should check the start of the source string
|
| 750 |
+
* for quick patterns without expensive regex operations.
|
| 751 |
+
*
|
| 752 |
+
* @param source The input source string (already trimmed of leading whitespace)
|
| 753 |
+
* @param state Current parser state
|
| 754 |
+
* @returns true if the rule should be attempted, false to skip
|
| 755 |
+
*/
|
| 756 |
+
_qualify?: string[] | ((source: string, state: MarkdownToJSX.State) => boolean);
|
| 757 |
+
_render?: (node: ParserOutput,
|
| 758 |
+
/**
|
| 759 |
+
* Continue rendering AST nodes if applicable.
|
| 760 |
+
*/
|
| 761 |
+
render: RuleOutput, state?: MarkdownToJSX.State) => React.ReactNode;
|
| 762 |
+
};
|
| 763 |
+
export type Rules = {
|
| 764 |
+
[K in ParserResult['type']]: K extends typeof RuleType.table ? Rule<Extract<ParserResult, {
|
| 765 |
+
type: K | typeof RuleType.paragraph;
|
| 766 |
+
}>> : Rule<Extract<ParserResult, {
|
| 767 |
+
type: K;
|
| 768 |
+
}>>;
|
| 769 |
+
};
|
| 770 |
+
export type Override = RequireAtLeastOne<{
|
| 771 |
+
component: React.ElementType;
|
| 772 |
+
props: Object;
|
| 773 |
+
}> | React.ElementType;
|
| 774 |
+
export type Overrides = {
|
| 775 |
+
[tag in HTMLTags]?: Override;
|
| 776 |
+
} & {
|
| 777 |
+
[customComponent: string]: Override;
|
| 778 |
+
};
|
| 779 |
+
export type Options = Partial<{
|
| 780 |
+
/**
|
| 781 |
+
* Ultimate control over the output of all rendered JSX.
|
| 782 |
+
*/
|
| 783 |
+
createElement: (tag: Parameters<CreateElement>[0], props: React.JSX.IntrinsicAttributes, ...children: React.ReactNode[]) => React.ReactNode;
|
| 784 |
+
/**
|
| 785 |
+
* The library automatically generates an anchor tag for bare URLs included in the markdown
|
| 786 |
+
* document, but this behavior can be disabled if desired.
|
| 787 |
+
*/
|
| 788 |
+
disableAutoLink: boolean;
|
| 789 |
+
/**
|
| 790 |
+
* Disable the compiler's best-effort transcription of provided raw HTML
|
| 791 |
+
* into JSX-equivalent. This is the functionality that prevents the need to
|
| 792 |
+
* use `dangerouslySetInnerHTML` in React.
|
| 793 |
+
*/
|
| 794 |
+
disableParsingRawHTML: boolean;
|
| 795 |
+
/**
|
| 796 |
+
* Forces the compiler to have space between hash sign and the header text which
|
| 797 |
+
* is explicitly stated in the most of the markdown specs.
|
| 798 |
+
* https://github.github.com/gfm/#atx-heading
|
| 799 |
+
* `The opening sequence of # characters must be followed by a space or by the end of line.`
|
| 800 |
+
*/
|
| 801 |
+
enforceAtxHeadings: boolean;
|
| 802 |
+
/**
|
| 803 |
+
* Forces the compiler to always output content with a block-level wrapper
|
| 804 |
+
* (`<p>` or any block-level syntax your markdown already contains.)
|
| 805 |
+
*/
|
| 806 |
+
forceBlock: boolean;
|
| 807 |
+
/**
|
| 808 |
+
* Forces the compiler to always output content with an inline wrapper (`<span>`)
|
| 809 |
+
*/
|
| 810 |
+
forceInline: boolean;
|
| 811 |
+
/**
|
| 812 |
+
* Forces the compiler to wrap results, even if there is only a single
|
| 813 |
+
* child or no children.
|
| 814 |
+
*/
|
| 815 |
+
forceWrapper: boolean;
|
| 816 |
+
/**
|
| 817 |
+
* Supply additional HTML entity: unicode replacement mappings.
|
| 818 |
+
*
|
| 819 |
+
* Pass only the inner part of the entity as the key,
|
| 820 |
+
* e.g. `≤` -> `{ "le": "\u2264" }`
|
| 821 |
+
*
|
| 822 |
+
* By default
|
| 823 |
+
* the following entities are replaced with their unicode equivalents:
|
| 824 |
+
*
|
| 825 |
+
* ```
|
| 826 |
+
* &
|
| 827 |
+
* '
|
| 828 |
+
* >
|
| 829 |
+
* <
|
| 830 |
+
*
|
| 831 |
+
* "
|
| 832 |
+
* ```
|
| 833 |
+
*/
|
| 834 |
+
namedCodesToUnicode: {
|
| 835 |
+
[key: string]: string;
|
| 836 |
+
};
|
| 837 |
+
/**
|
| 838 |
+
* Selectively control the output of particular HTML tags as they would be
|
| 839 |
+
* emitted by the compiler.
|
| 840 |
+
*/
|
| 841 |
+
overrides: Overrides;
|
| 842 |
+
/**
|
| 843 |
+
* Allows for full control over rendering of particular rules.
|
| 844 |
+
* For example, to implement a LaTeX renderer such as `react-katex`:
|
| 845 |
+
*
|
| 846 |
+
* ```
|
| 847 |
+
* renderRule(next, node, renderChildren, state) {
|
| 848 |
+
* if (node.type === RuleType.codeBlock && node.lang === 'latex') {
|
| 849 |
+
* return (
|
| 850 |
+
* <TeX as="div" key={state.key}>
|
| 851 |
+
* {String.raw`${node.text}`}
|
| 852 |
+
* </TeX>
|
| 853 |
+
* )
|
| 854 |
+
* }
|
| 855 |
+
*
|
| 856 |
+
* return next();
|
| 857 |
+
* }
|
| 858 |
+
* ```
|
| 859 |
+
*
|
| 860 |
+
* Thar be dragons obviously, but you can do a lot with this
|
| 861 |
+
* (have fun!) To see how things work internally, check the `render`
|
| 862 |
+
* method in source for a particular rule.
|
| 863 |
+
*/
|
| 864 |
+
renderRule: (
|
| 865 |
+
/** Resume normal processing, call this function as a fallback if you are not returning custom JSX. */
|
| 866 |
+
next: () => React.ReactNode,
|
| 867 |
+
/** the current AST node, use `RuleType` against `node.type` for identification */
|
| 868 |
+
node: ParserResult,
|
| 869 |
+
/** use as `renderChildren(node.children)` for block nodes */
|
| 870 |
+
renderChildren: RuleOutput,
|
| 871 |
+
/** contains `key` which should be supplied to the topmost JSX element */
|
| 872 |
+
state: State) => React.ReactNode;
|
| 873 |
+
/**
|
| 874 |
+
* Override the built-in sanitizer function for URLs, etc if desired. The built-in version is available as a library export called `sanitizer`.
|
| 875 |
+
*/
|
| 876 |
+
sanitizer: (value: string, tag: HTMLTags, attribute: string) => string | null;
|
| 877 |
+
/**
|
| 878 |
+
* Override normalization of non-URI-safe characters for use in generating
|
| 879 |
+
* HTML IDs for anchor linking purposes.
|
| 880 |
+
*/
|
| 881 |
+
slugify: (input: string, defaultFn: (input: string) => string) => string;
|
| 882 |
+
/**
|
| 883 |
+
* Declare the type of the wrapper to be used when there are multiple
|
| 884 |
+
* children to render. Set to `null` to get an array of children back
|
| 885 |
+
* without any wrapper, or use `React.Fragment` to get a React element
|
| 886 |
+
* that won't show up in the DOM.
|
| 887 |
+
*/
|
| 888 |
+
wrapper: React.ElementType | null;
|
| 889 |
+
}>;
|
| 890 |
+
export { };
|
| 891 |
+
}
|
| 892 |
+
|
| 893 |
+
type MarkdownProps = typeof Markdown$1 extends React__default.ComponentType<infer Props> ? Props : never;
|
| 894 |
+
declare const Markdown: (props: MarkdownProps) => React__default.JSX.Element | null;
|
| 895 |
+
|
| 896 |
+
type MetaProps = BaseAnnotations & {
|
| 897 |
+
of?: ModuleExports;
|
| 898 |
+
title?: string;
|
| 899 |
+
};
|
| 900 |
+
/**
|
| 901 |
+
* This component is used to declare component metadata in docs and gets transformed into a default
|
| 902 |
+
* export underneath the hood.
|
| 903 |
+
*/
|
| 904 |
+
declare const Meta: FC<MetaProps>;
|
| 905 |
+
|
| 906 |
+
declare const Primary: FC;
|
| 907 |
+
|
| 908 |
+
interface StoriesProps {
|
| 909 |
+
title?: ReactElement | string;
|
| 910 |
+
includePrimary?: boolean;
|
| 911 |
+
}
|
| 912 |
+
declare const Stories: FC<StoriesProps>;
|
| 913 |
+
|
| 914 |
+
declare const Subheading: FC<PropsWithChildren<HeadingProps>>;
|
| 915 |
+
|
| 916 |
+
interface SubtitleProps {
|
| 917 |
+
children?: ReactNode;
|
| 918 |
+
/**
|
| 919 |
+
* Specify where to get the subtitle from. If not specified, the subtitle will be extracted from
|
| 920 |
+
* the meta of the attached CSF file.
|
| 921 |
+
*/
|
| 922 |
+
of?: Of;
|
| 923 |
+
}
|
| 924 |
+
declare const Subtitle: FunctionComponent<SubtitleProps>;
|
| 925 |
+
|
| 926 |
+
interface TitleProps {
|
| 927 |
+
/**
|
| 928 |
+
* Specify where to get the title from. Must be a CSF file's default export. If not specified, the
|
| 929 |
+
* title will be read from children, or extracted from the meta of the attached CSF file.
|
| 930 |
+
*/
|
| 931 |
+
of?: Of;
|
| 932 |
+
/** Specify content to display as the title. */
|
| 933 |
+
children?: ReactNode;
|
| 934 |
+
}
|
| 935 |
+
declare const extractTitle: (title: ComponentTitle) => string;
|
| 936 |
+
declare const Title: FunctionComponent<TitleProps>;
|
| 937 |
+
|
| 938 |
+
declare const Unstyled: React__default.FC<React__default.DetailedHTMLProps<React__default.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
| 939 |
+
|
| 940 |
+
declare const Wrapper: FC<React__default.DetailedHTMLProps<React__default.HTMLAttributes<HTMLDivElement>, HTMLDivElement>>;
|
| 941 |
+
|
| 942 |
+
declare const assertIsFn: (val: any) => any;
|
| 943 |
+
declare const AddContext: FC<PropsWithChildren<DocsContextProps>>;
|
| 944 |
+
interface CodeOrSourceMdxProps {
|
| 945 |
+
className?: string;
|
| 946 |
+
}
|
| 947 |
+
declare const CodeOrSourceMdx: FC<PropsWithChildren<CodeOrSourceMdxProps>>;
|
| 948 |
+
interface AnchorMdxProps {
|
| 949 |
+
href: string;
|
| 950 |
+
target: string;
|
| 951 |
+
}
|
| 952 |
+
declare const AnchorMdx: FC<PropsWithChildren<AnchorMdxProps>>;
|
| 953 |
+
interface HeaderMdxProps {
|
| 954 |
+
as: string;
|
| 955 |
+
id: string;
|
| 956 |
+
}
|
| 957 |
+
declare const HeaderMdx: FC<PropsWithChildren<HeaderMdxProps>>;
|
| 958 |
+
declare const HeadersMdx: {};
|
| 959 |
+
|
| 960 |
+
interface ControlProps<T> {
|
| 961 |
+
name: string;
|
| 962 |
+
value?: T;
|
| 963 |
+
defaultValue?: T;
|
| 964 |
+
argType?: ArgType;
|
| 965 |
+
onChange: (value?: T) => T | void;
|
| 966 |
+
onFocus?: (evt: any) => void;
|
| 967 |
+
onBlur?: (evt: any) => void;
|
| 968 |
+
}
|
| 969 |
+
type BooleanValue = boolean;
|
| 970 |
+
interface BooleanConfig {
|
| 971 |
+
}
|
| 972 |
+
type ColorValue = string;
|
| 973 |
+
type PresetColor = ColorValue | {
|
| 974 |
+
color: ColorValue;
|
| 975 |
+
title?: string;
|
| 976 |
+
};
|
| 977 |
+
interface ColorConfig {
|
| 978 |
+
presetColors?: PresetColor[];
|
| 979 |
+
/**
|
| 980 |
+
* Whether the color picker should be open by default when rendered.
|
| 981 |
+
*
|
| 982 |
+
* @default false
|
| 983 |
+
*/
|
| 984 |
+
startOpen?: boolean;
|
| 985 |
+
}
|
| 986 |
+
type DateValue = Date | number;
|
| 987 |
+
interface DateConfig {
|
| 988 |
+
}
|
| 989 |
+
type NumberValue = number;
|
| 990 |
+
interface NumberConfig {
|
| 991 |
+
min?: number;
|
| 992 |
+
max?: number;
|
| 993 |
+
step?: number;
|
| 994 |
+
}
|
| 995 |
+
type RangeConfig = NumberConfig;
|
| 996 |
+
type ObjectValue = any;
|
| 997 |
+
interface ObjectConfig {
|
| 998 |
+
}
|
| 999 |
+
type OptionsSingleSelection = any;
|
| 1000 |
+
type OptionsMultiSelection = any[];
|
| 1001 |
+
type OptionsSelection = OptionsSingleSelection | OptionsMultiSelection;
|
| 1002 |
+
type OptionsArray = any[];
|
| 1003 |
+
type OptionsObject = Record<string, any>;
|
| 1004 |
+
type Options = OptionsArray | OptionsObject;
|
| 1005 |
+
type OptionsControlType = 'radio' | 'inline-radio' | 'check' | 'inline-check' | 'select' | 'multi-select';
|
| 1006 |
+
interface OptionsConfig {
|
| 1007 |
+
labels?: Record<any, string>;
|
| 1008 |
+
type: OptionsControlType;
|
| 1009 |
+
}
|
| 1010 |
+
interface NormalizedOptionsConfig {
|
| 1011 |
+
options: OptionsObject;
|
| 1012 |
+
}
|
| 1013 |
+
type TextValue = string;
|
| 1014 |
+
interface TextConfig {
|
| 1015 |
+
maxLength?: number;
|
| 1016 |
+
}
|
| 1017 |
+
type ControlType = 'array' | 'boolean' | 'color' | 'date' | 'number' | 'range' | 'object' | OptionsControlType | 'text';
|
| 1018 |
+
type Control = BooleanConfig | ColorConfig | DateConfig | NumberConfig | ObjectConfig | OptionsConfig | RangeConfig | TextConfig;
|
| 1019 |
+
|
| 1020 |
+
type ColorControlProps = ControlProps<ColorValue> & ColorConfig;
|
| 1021 |
+
|
| 1022 |
+
type BooleanProps = ControlProps<BooleanValue> & BooleanConfig;
|
| 1023 |
+
/**
|
| 1024 |
+
* # Boolean Control
|
| 1025 |
+
*
|
| 1026 |
+
* Renders a switch toggle with "True" or "False". or if the value is `undefined`, renders a button
|
| 1027 |
+
* to set the boolean.
|
| 1028 |
+
*
|
| 1029 |
+
* ## Example usage
|
| 1030 |
+
*
|
| 1031 |
+
* ```
|
| 1032 |
+
* <BooleanControl name="isTrue" value={value} onChange={handleValueChange} />;
|
| 1033 |
+
* ```
|
| 1034 |
+
*/
|
| 1035 |
+
declare const BooleanControl: FC<BooleanProps>;
|
| 1036 |
+
|
| 1037 |
+
declare const parseDate: (value: string) => Date;
|
| 1038 |
+
declare const parseTime: (value: string) => Date;
|
| 1039 |
+
declare const formatDate: (value: Date | number) => string;
|
| 1040 |
+
declare const formatTime: (value: Date | number) => string;
|
| 1041 |
+
type DateProps = ControlProps<DateValue> & DateConfig;
|
| 1042 |
+
declare const DateControl: FC<DateProps>;
|
| 1043 |
+
|
| 1044 |
+
type NumberProps = ControlProps<NumberValue | null> & NumberConfig;
|
| 1045 |
+
declare const parse: (value: string) => number | undefined;
|
| 1046 |
+
declare const format: (value: NumberValue) => string;
|
| 1047 |
+
declare const NumberControl: FC<NumberProps>;
|
| 1048 |
+
|
| 1049 |
+
type OptionsProps = ControlProps<OptionsSelection> & OptionsConfig;
|
| 1050 |
+
declare const OptionsControl: FC<OptionsProps>;
|
| 1051 |
+
|
| 1052 |
+
type ObjectProps = ControlProps<ObjectValue> & ObjectConfig;
|
| 1053 |
+
declare const ObjectControl: FC<ObjectProps>;
|
| 1054 |
+
|
| 1055 |
+
type RangeProps = ControlProps<NumberValue | null> & RangeConfig;
|
| 1056 |
+
declare const RangeControl: FC<RangeProps>;
|
| 1057 |
+
|
| 1058 |
+
type TextProps = ControlProps<TextValue | undefined> & TextConfig;
|
| 1059 |
+
declare const TextControl: FC<TextProps>;
|
| 1060 |
+
|
| 1061 |
+
interface FilesControlProps extends ControlProps<string[]> {
|
| 1062 |
+
/**
|
| 1063 |
+
* The accept attribute value is a string that defines the file types the file input should
|
| 1064 |
+
* accept. This string is a comma-separated list of unique file type specifiers.
|
| 1065 |
+
*
|
| 1066 |
+
* @example _/_
|
| 1067 |
+
*
|
| 1068 |
+
* @example .webm,video/webm
|
| 1069 |
+
*
|
| 1070 |
+
* @example .doc,.docx,application/msword
|
| 1071 |
+
*
|
| 1072 |
+
* @defaultValue `image/*`
|
| 1073 |
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept
|
| 1074 |
+
*/
|
| 1075 |
+
accept?: string;
|
| 1076 |
+
}
|
| 1077 |
+
declare const FilesControl: FC<FilesControlProps>;
|
| 1078 |
+
|
| 1079 |
+
type ColorProps = ColorControlProps;
|
| 1080 |
+
declare const LazyColorControl: React__default.LazyExoticComponent<React__default.FC<ColorControlProps>>;
|
| 1081 |
+
declare const ColorControl: (props: ComponentProps<typeof LazyColorControl>) => React__default.JSX.Element;
|
| 1082 |
+
|
| 1083 |
+
export { AddContext, Anchor, AnchorMdx, type AnchorProps, ArgTypes, type BooleanConfig, BooleanControl, type BooleanProps, type BooleanValue, Canvas, CodeOrSourceMdx, type ColorConfig, ColorControl, ColorItem, ColorPalette, type ColorProps, type ColorValue, type Component, type Control, type ControlProps, type ControlType, Controls, type DateConfig, DateControl, type DateProps, type DateValue, DescriptionContainer as Description, DescriptionType, Docs, DocsContainer, type DocsContainerProps, DocsContext, DocsPage, type DocsProps, DocsStory, type DocsStoryProps, ExternalDocs, ExternalDocsContainer, type ExternalDocsProps, FilesControl, type FilesControlProps, HeaderMdx, HeadersMdx, Heading, type HeadingProps, IconGallery, IconItem, Markdown, Meta, type NormalizedOptionsConfig, type NumberConfig, NumberControl, type NumberValue, type ObjectConfig, ObjectControl, type ObjectProps, type ObjectValue, type Of, type Options, type OptionsArray, type OptionsConfig, OptionsControl, type OptionsControlType, type OptionsMultiSelection, type OptionsObject, type OptionsProps, type OptionsSelection, type OptionsSingleSelection, PRIMARY_STORY, type PresetColor, Primary, ArgsTable as PureArgsTable, type RangeConfig, RangeControl, type SortType, Source, SourceContainer, SourceContext, type SourceContextProps, type SourceItem, type SourceParameters, type SourceProps, Stories, Story, type StoryProps, type StorySources, Subheading, Subtitle, TableOfContents, type TextConfig, TextControl, type TextProps, type TextValue, Title, Typeset, UNKNOWN_ARGS_HASH, Unstyled, Wrapper, anchorBlockIdFromId, argsHash, assertIsFn, extractTitle, format, formatDate, formatTime, getStoryId, getStoryProps, parse, parseDate, parseTime, slugs, useOf, useSourceProps };
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/blocks.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/ember/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const setJSONDoc: (jsondoc: any) => void;
|
| 2 |
+
|
| 3 |
+
export { setJSONDoc };
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/ember/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import "../_browser-chunks/chunk-SL3VIQZ3.js";
|
| 2 |
+
|
| 3 |
+
// src/ember/index.ts
|
| 4 |
+
var setJSONDoc = (jsondoc) => {
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import * as storybook_internal_csf from 'storybook/internal/csf';
|
| 2 |
+
import React$1, { ReactElement, ComponentType } from 'react';
|
| 3 |
+
import { Renderer, DocsContextProps, ModuleExport, ModuleExports, DocsRenderFunction } from 'storybook/internal/types';
|
| 4 |
+
import { ThemeVars } from 'storybook/theming';
|
| 5 |
+
|
| 6 |
+
interface TocbotOptions {
|
| 7 |
+
tocSelector: string;
|
| 8 |
+
contentSelector: string;
|
| 9 |
+
headingSelector: string;
|
| 10 |
+
ignoreSelector?: string;
|
| 11 |
+
headingsOffset?: number;
|
| 12 |
+
scrollSmoothOffset?: number;
|
| 13 |
+
orderedList?: boolean;
|
| 14 |
+
onClick?: (e: MouseEvent) => void;
|
| 15 |
+
scrollEndCallback?: () => void;
|
| 16 |
+
[key: string]: unknown;
|
| 17 |
+
}
|
| 18 |
+
interface TocParameters {
|
| 19 |
+
/** CSS selector for the container to search for headings. */
|
| 20 |
+
contentsSelector?: string;
|
| 21 |
+
/**
|
| 22 |
+
* When true, hide the TOC. We still show the empty container (as opposed to showing nothing at
|
| 23 |
+
* all) because it affects the page layout and we want to preserve the layout across pages.
|
| 24 |
+
*/
|
| 25 |
+
disable?: boolean;
|
| 26 |
+
/** CSS selector to match headings to list in the TOC. */
|
| 27 |
+
headingSelector?: string;
|
| 28 |
+
/** Headings that match the ignoreSelector will be skipped. */
|
| 29 |
+
ignoreSelector?: string;
|
| 30 |
+
/** Custom title ReactElement or string to display above the TOC. */
|
| 31 |
+
title?: ReactElement | string | null;
|
| 32 |
+
/**
|
| 33 |
+
* TocBot options, not guaranteed to be available in future versions.
|
| 34 |
+
*
|
| 35 |
+
* @see tocbot docs {@link https://tscanlin.github.io/tocbot/#usage}
|
| 36 |
+
*/
|
| 37 |
+
unsafeTocbotOptions?: Omit<TocbotOptions, 'onClick' | 'scrollEndCallback'>;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
interface DocsContainerProps<TFramework extends Renderer = Renderer> {
|
| 41 |
+
context: DocsContextProps<TFramework>;
|
| 42 |
+
theme?: ThemeVars;
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
type StoryBlockParameters = {
|
| 46 |
+
/** Whether a story's play function runs when shown in docs page */
|
| 47 |
+
autoplay?: boolean;
|
| 48 |
+
/**
|
| 49 |
+
* Set a minimum height (note for an iframe this is the actual height) when rendering a story in
|
| 50 |
+
* an iframe or inline. This overrides `parameters.docs.story.iframeHeight` for iframes.
|
| 51 |
+
*/
|
| 52 |
+
height?: string;
|
| 53 |
+
/** IFrame configuration */
|
| 54 |
+
iframeHeight?: string;
|
| 55 |
+
/**
|
| 56 |
+
* Whether the story is rendered inline (in the same browser frame as the other docs content) or
|
| 57 |
+
* in an iframe
|
| 58 |
+
*/
|
| 59 |
+
inline?: boolean;
|
| 60 |
+
/** Specifies the CSF file to which the story is associated */
|
| 61 |
+
meta: ModuleExports;
|
| 62 |
+
/**
|
| 63 |
+
* Specifies which story is rendered by the Story block. If no `of` is defined and the MDX file is
|
| 64 |
+
* attached, the primary (first) story will be rendered.
|
| 65 |
+
*/
|
| 66 |
+
of: ModuleExport;
|
| 67 |
+
};
|
| 68 |
+
type ControlsBlockParameters = {
|
| 69 |
+
/** Exclude specific properties from the Controls panel */
|
| 70 |
+
exclude?: string[] | RegExp;
|
| 71 |
+
/** Exclude only specific properties in the Controls panel */
|
| 72 |
+
include?: string[] | RegExp;
|
| 73 |
+
/** Controls sorting order */
|
| 74 |
+
sort?: 'none' | 'alpha' | 'requiredFirst';
|
| 75 |
+
};
|
| 76 |
+
type ArgTypesBlockParameters = {
|
| 77 |
+
/** Exclude specific arg types from the args table */
|
| 78 |
+
exclude?: string[] | RegExp;
|
| 79 |
+
/** Exclude only specific arg types from the args table */
|
| 80 |
+
include?: string[] | RegExp;
|
| 81 |
+
/**
|
| 82 |
+
* Specifies which story to get the arg types from. If a CSF file exports is provided, it will use
|
| 83 |
+
* the primary (first) story in the file.
|
| 84 |
+
*/
|
| 85 |
+
of: ModuleExport | ModuleExports;
|
| 86 |
+
/**
|
| 87 |
+
* Controls arg types order
|
| 88 |
+
*
|
| 89 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-argtypes#sort
|
| 90 |
+
*/
|
| 91 |
+
sort?: 'none' | 'alpha' | 'requiredFirst';
|
| 92 |
+
};
|
| 93 |
+
type CanvasBlockParameters = {
|
| 94 |
+
/**
|
| 95 |
+
* Provides any additional custom actions to show in the bottom right corner. These are simple
|
| 96 |
+
* buttons that do anything you specify in the onClick function.
|
| 97 |
+
*/
|
| 98 |
+
additionalActions?: {
|
| 99 |
+
className?: string;
|
| 100 |
+
disabled?: boolean;
|
| 101 |
+
onClick: () => void;
|
| 102 |
+
title: string | React.JSX.Element;
|
| 103 |
+
}[];
|
| 104 |
+
/** Provide HTML class(es) to the preview element, for custom styling. */
|
| 105 |
+
className?: string;
|
| 106 |
+
/**
|
| 107 |
+
* Specify how the canvas should layout the story.
|
| 108 |
+
*
|
| 109 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-canvas#layout
|
| 110 |
+
*/
|
| 111 |
+
layout?: 'centered' | 'fullscreen' | 'padded';
|
| 112 |
+
/** Specifies which story is rendered */
|
| 113 |
+
of: ModuleExport;
|
| 114 |
+
/** Show story source code */
|
| 115 |
+
sourceState?: 'hidden' | 'shown';
|
| 116 |
+
/**
|
| 117 |
+
* Story configuration
|
| 118 |
+
*
|
| 119 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-canvas#story
|
| 120 |
+
*/
|
| 121 |
+
story?: StoryBlockParameters;
|
| 122 |
+
/** Disable story source code */
|
| 123 |
+
withSource?: 'open' | 'closed' | 'none';
|
| 124 |
+
/** Whether to render a toolbar containing tools to interact with the story. */
|
| 125 |
+
withToolbar?: 'open' | 'closed' | 'none';
|
| 126 |
+
};
|
| 127 |
+
type DescriptionBlockParameters = {
|
| 128 |
+
/** Component description */
|
| 129 |
+
component?: string;
|
| 130 |
+
/** Story description */
|
| 131 |
+
story?: string;
|
| 132 |
+
};
|
| 133 |
+
type SourceBlockParameters = {
|
| 134 |
+
/** The source code to be rendered. Will be inferred if not passed */
|
| 135 |
+
code?: string;
|
| 136 |
+
/** Whether to render the code in dark mode */
|
| 137 |
+
dark?: boolean;
|
| 138 |
+
/** Determines if decorators are rendered in the source code snippet. */
|
| 139 |
+
excludeDecorators?: boolean;
|
| 140 |
+
/**
|
| 141 |
+
* The formatting used on source code. Both true and 'dedent' have the same effect of removing any
|
| 142 |
+
* extraneous indentation. Supports all valid prettier parser names.
|
| 143 |
+
*/
|
| 144 |
+
format?: boolean | 'dedent' | string;
|
| 145 |
+
/** Source code language */
|
| 146 |
+
language?: 'bash' | 'css' | 'graphql' | 'html' | 'json' | 'jsextra' | 'jsx' | 'md' | 'text' | 'tsx' | 'typescript' | 'yml';
|
| 147 |
+
/**
|
| 148 |
+
* Specifies which story is rendered by the Source block. If no of is defined and the MDX file is
|
| 149 |
+
* attached, the primary (first) story will be rendered.
|
| 150 |
+
*/
|
| 151 |
+
of: ModuleExport;
|
| 152 |
+
/** Source code transformations */
|
| 153 |
+
transform?: (code: string, storyContext: any) => string | Promise<string>;
|
| 154 |
+
/**
|
| 155 |
+
* Specifies how the source code is rendered.
|
| 156 |
+
*
|
| 157 |
+
* @default 'auto'
|
| 158 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-source#type
|
| 159 |
+
*/
|
| 160 |
+
type?: 'auto' | 'code' | 'dynamic';
|
| 161 |
+
};
|
| 162 |
+
interface DocsParameters {
|
| 163 |
+
/**
|
| 164 |
+
* Docs configuration
|
| 165 |
+
*
|
| 166 |
+
* @see https://storybook.js.org/docs/writing-docs
|
| 167 |
+
*/
|
| 168 |
+
docs?: {
|
| 169 |
+
/**
|
| 170 |
+
* The subtitle displayed when shown in docs page
|
| 171 |
+
*
|
| 172 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-argtypes
|
| 173 |
+
*/
|
| 174 |
+
argTypes?: ArgTypesBlockParameters;
|
| 175 |
+
/**
|
| 176 |
+
* Canvas configuration when shown in docs page
|
| 177 |
+
*
|
| 178 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-canvas
|
| 179 |
+
*/
|
| 180 |
+
canvas?: Partial<CanvasBlockParameters>;
|
| 181 |
+
/**
|
| 182 |
+
* Enable the Code panel.
|
| 183 |
+
*
|
| 184 |
+
* @see https://storybook.js.org/docs/writing-docs/code-panel
|
| 185 |
+
*/
|
| 186 |
+
codePanel?: boolean;
|
| 187 |
+
/**
|
| 188 |
+
* Controls block configuration
|
| 189 |
+
*
|
| 190 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-controls
|
| 191 |
+
*/
|
| 192 |
+
controls?: ControlsBlockParameters;
|
| 193 |
+
/**
|
| 194 |
+
* Customize the Docs Container
|
| 195 |
+
*
|
| 196 |
+
* @see https://storybook.js.org/docs/writing-docs/autodocs#customize-the-docs-container
|
| 197 |
+
*/
|
| 198 |
+
container?: ComponentType<DocsContainerProps>;
|
| 199 |
+
/**
|
| 200 |
+
* Component/story description when shown in docs page
|
| 201 |
+
*
|
| 202 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-description#writing-descriptions
|
| 203 |
+
*/
|
| 204 |
+
description?: DescriptionBlockParameters;
|
| 205 |
+
/** Remove the addon panel and disable the addon's behavior */
|
| 206 |
+
disable?: boolean;
|
| 207 |
+
/**
|
| 208 |
+
* Replace the default documentation template used by Storybook with your own
|
| 209 |
+
*
|
| 210 |
+
* @see https://storybook.js.org/docs/writing-docs/autodocs#write-a-custom-template
|
| 211 |
+
*/
|
| 212 |
+
page?: ComponentType;
|
| 213 |
+
/**
|
| 214 |
+
* Source code configuration when shown in docs page
|
| 215 |
+
*
|
| 216 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-source
|
| 217 |
+
*/
|
| 218 |
+
source?: Partial<SourceBlockParameters>;
|
| 219 |
+
/**
|
| 220 |
+
* Story configuration
|
| 221 |
+
*
|
| 222 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-story
|
| 223 |
+
*/
|
| 224 |
+
story?: Partial<StoryBlockParameters>;
|
| 225 |
+
/**
|
| 226 |
+
* The subtitle displayed when shown in docs page
|
| 227 |
+
*
|
| 228 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-subtitle
|
| 229 |
+
*/
|
| 230 |
+
subtitle?: string;
|
| 231 |
+
/**
|
| 232 |
+
* Override the default theme
|
| 233 |
+
*
|
| 234 |
+
* @see https://storybook.js.org/docs/writing-docs/autodocs#override-the-default-theme
|
| 235 |
+
*/
|
| 236 |
+
theme?: ThemeVars;
|
| 237 |
+
/**
|
| 238 |
+
* The title displayed when shown in docs page
|
| 239 |
+
*
|
| 240 |
+
* @see https://storybook.js.org/docs/api/doc-blocks/doc-block-title
|
| 241 |
+
*/
|
| 242 |
+
title?: string;
|
| 243 |
+
/**
|
| 244 |
+
* Configure the table of contents
|
| 245 |
+
*
|
| 246 |
+
* @see https://storybook.js.org/docs/writing-docs/autodocs#configure-the-table-of-contents
|
| 247 |
+
*/
|
| 248 |
+
toc?: true | TocParameters;
|
| 249 |
+
};
|
| 250 |
+
}
|
| 251 |
+
interface DocsTypes {
|
| 252 |
+
parameters: DocsParameters;
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
+
declare class DocsRenderer<TRenderer extends Renderer> {
|
| 256 |
+
render: DocsRenderFunction<TRenderer>;
|
| 257 |
+
unmount: (element: HTMLElement) => void;
|
| 258 |
+
constructor();
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
declare module 'mdx/types' {
|
| 262 |
+
namespace JSX {
|
| 263 |
+
type Element = React$1.JSX.Element;
|
| 264 |
+
type ElementClass = React$1.JSX.ElementClass;
|
| 265 |
+
type IntrinsicElements = React$1.JSX.IntrinsicElements;
|
| 266 |
+
}
|
| 267 |
+
}
|
| 268 |
+
declare const _default: () => storybook_internal_csf.PreviewAddon<DocsTypes>;
|
| 269 |
+
|
| 270 |
+
export { DocsRenderer, type DocsTypes, _default as default };
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import {
|
| 2 |
+
DocsRenderer
|
| 3 |
+
} from "./_browser-chunks/chunk-OATZR77O.js";
|
| 4 |
+
import {
|
| 5 |
+
preview_exports
|
| 6 |
+
} from "./_browser-chunks/chunk-S4QKU6I5.js";
|
| 7 |
+
import "./_browser-chunks/chunk-SL3VIQZ3.js";
|
| 8 |
+
|
| 9 |
+
// src/index.ts
|
| 10 |
+
import { definePreviewAddon } from "storybook/internal/csf";
|
| 11 |
+
var index_default = () => definePreviewAddon(preview_exports);
|
| 12 |
+
export {
|
| 13 |
+
DocsRenderer,
|
| 14 |
+
index_default as default
|
| 15 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/manager.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import {
|
| 2 |
+
Source
|
| 3 |
+
} from "./_browser-chunks/chunk-AAVP3AE4.js";
|
| 4 |
+
import "./_browser-chunks/chunk-SL3VIQZ3.js";
|
| 5 |
+
|
| 6 |
+
// src/manager.tsx
|
| 7 |
+
import React, { useEffect, useState } from "react";
|
| 8 |
+
import { AddonPanel } from "storybook/internal/components";
|
| 9 |
+
import { addons, types, useChannel, useParameter } from "storybook/manager-api";
|
| 10 |
+
import { ignoreSsrWarning, styled, useTheme } from "storybook/theming";
|
| 11 |
+
|
| 12 |
+
// ../../core/src/docs-tools/shared.ts
|
| 13 |
+
var ADDON_ID = "storybook/docs", PANEL_ID = `${ADDON_ID}/panel`, PARAM_KEY = "docs", SNIPPET_RENDERED = `${ADDON_ID}/snippet-rendered`;
|
| 14 |
+
|
| 15 |
+
// src/manager.tsx
|
| 16 |
+
var CodePanel = ({
|
| 17 |
+
active,
|
| 18 |
+
lastEvent,
|
| 19 |
+
currentStoryId
|
| 20 |
+
}) => {
|
| 21 |
+
let [codeSnippet, setSourceCode] = useState({
|
| 22 |
+
source: lastEvent?.source,
|
| 23 |
+
format: lastEvent?.format ?? void 0
|
| 24 |
+
}), parameter = useParameter(PARAM_KEY, {
|
| 25 |
+
source: { code: "" },
|
| 26 |
+
theme: "dark"
|
| 27 |
+
});
|
| 28 |
+
useEffect(() => {
|
| 29 |
+
setSourceCode({
|
| 30 |
+
source: void 0,
|
| 31 |
+
format: void 0
|
| 32 |
+
});
|
| 33 |
+
}, [currentStoryId]), useChannel({
|
| 34 |
+
[SNIPPET_RENDERED]: ({ source, format }) => {
|
| 35 |
+
setSourceCode({ source, format });
|
| 36 |
+
}
|
| 37 |
+
});
|
| 38 |
+
let isDark = useTheme().base !== "light";
|
| 39 |
+
return React.createElement(AddonPanel, { active: !!active }, React.createElement(SourceStyles, null, React.createElement(
|
| 40 |
+
Source,
|
| 41 |
+
{
|
| 42 |
+
...parameter.source,
|
| 43 |
+
code: parameter.source?.code || codeSnippet.source || parameter.source?.originalSource,
|
| 44 |
+
format: codeSnippet.format,
|
| 45 |
+
dark: isDark
|
| 46 |
+
}
|
| 47 |
+
)));
|
| 48 |
+
};
|
| 49 |
+
addons.register(ADDON_ID, (api) => {
|
| 50 |
+
addons.add(PANEL_ID, {
|
| 51 |
+
title: "Code",
|
| 52 |
+
type: types.PANEL,
|
| 53 |
+
paramKey: PARAM_KEY,
|
| 54 |
+
/**
|
| 55 |
+
* This code panel can be enabled by adding this parameter:
|
| 56 |
+
*
|
| 57 |
+
* @example
|
| 58 |
+
*
|
| 59 |
+
* ```ts
|
| 60 |
+
* parameters: {
|
| 61 |
+
* docs: {
|
| 62 |
+
* codePanel: true,
|
| 63 |
+
* },
|
| 64 |
+
* },
|
| 65 |
+
* ```
|
| 66 |
+
*/
|
| 67 |
+
disabled: (parameters) => !parameters?.docs?.codePanel,
|
| 68 |
+
match: ({ viewMode }) => viewMode === "story",
|
| 69 |
+
render: ({ active }) => {
|
| 70 |
+
let channel = api.getChannel(), currentStory = api.getCurrentStoryData(), lastEvent = channel?.last(SNIPPET_RENDERED)?.[0];
|
| 71 |
+
return React.createElement(CodePanel, { currentStoryId: currentStory?.id, lastEvent, active });
|
| 72 |
+
}
|
| 73 |
+
});
|
| 74 |
+
});
|
| 75 |
+
var SourceStyles = styled.div(() => ({
|
| 76 |
+
height: "100%",
|
| 77 |
+
[`> :first-child${ignoreSsrWarning}`]: {
|
| 78 |
+
margin: 0,
|
| 79 |
+
height: "100%",
|
| 80 |
+
boxShadow: "none"
|
| 81 |
+
}
|
| 82 |
+
}));
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/mdx-loader.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import CJS_COMPAT_NODE_URL_t17piavj1z from 'node:url';
|
| 2 |
+
import CJS_COMPAT_NODE_PATH_t17piavj1z from 'node:path';
|
| 3 |
+
import CJS_COMPAT_NODE_MODULE_t17piavj1z from "node:module";
|
| 4 |
+
|
| 5 |
+
var __filename = CJS_COMPAT_NODE_URL_t17piavj1z.fileURLToPath(import.meta.url);
|
| 6 |
+
var __dirname = CJS_COMPAT_NODE_PATH_t17piavj1z.dirname(__filename);
|
| 7 |
+
var require = CJS_COMPAT_NODE_MODULE_t17piavj1z.createRequire(import.meta.url);
|
| 8 |
+
|
| 9 |
+
// ------------------------------------------------------------
|
| 10 |
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
| 11 |
+
// ------------------------------------------------------------
|
| 12 |
+
import {
|
| 13 |
+
compile
|
| 14 |
+
} from "./_node-chunks/chunk-SOR3F7GI.js";
|
| 15 |
+
import "./_node-chunks/chunk-2SCGLXP5.js";
|
| 16 |
+
import "./_node-chunks/chunk-4WYSRR6Q.js";
|
| 17 |
+
import "./_node-chunks/chunk-G6W4HXRC.js";
|
| 18 |
+
|
| 19 |
+
// src/mdx-loader.ts
|
| 20 |
+
var DEFAULT_RENDERER = `
|
| 21 |
+
import React from 'react';
|
| 22 |
+
`;
|
| 23 |
+
async function loader(content) {
|
| 24 |
+
let callback = this.async(), options = { ...this.getOptions(), filepath: this.resourcePath };
|
| 25 |
+
try {
|
| 26 |
+
let result = await compile(content, options), code = `${DEFAULT_RENDERER}
|
| 27 |
+
${result}`;
|
| 28 |
+
return callback(null, code);
|
| 29 |
+
} catch (err) {
|
| 30 |
+
return console.error("Error loading:", this.resourcePath), callback(err);
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
var mdx_loader_default = loader;
|
| 34 |
+
export {
|
| 35 |
+
mdx_loader_default as default
|
| 36 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/mdx-react-shim.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export * from '@mdx-js/react';
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/mdx-react-shim.js
ADDED
|
@@ -0,0 +1,2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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import CJS_COMPAT_NODE_URL_t17piavj1z from 'node:url';
|
| 2 |
+
import CJS_COMPAT_NODE_PATH_t17piavj1z from 'node:path';
|
| 3 |
+
import CJS_COMPAT_NODE_MODULE_t17piavj1z from "node:module";
|
| 4 |
+
|
| 5 |
+
var __filename = CJS_COMPAT_NODE_URL_t17piavj1z.fileURLToPath(import.meta.url);
|
| 6 |
+
var __dirname = CJS_COMPAT_NODE_PATH_t17piavj1z.dirname(__filename);
|
| 7 |
+
var require = CJS_COMPAT_NODE_MODULE_t17piavj1z.createRequire(import.meta.url);
|
| 8 |
+
|
| 9 |
+
// ------------------------------------------------------------
|
| 10 |
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
| 11 |
+
// ------------------------------------------------------------
|
| 12 |
+
import "./_node-chunks/chunk-G6W4HXRC.js";
|
| 13 |
+
|
| 14 |
+
// src/preset.ts
|
| 15 |
+
import { isAbsolute as isAbsolute2 } from "node:path";
|
| 16 |
+
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
| 17 |
+
import { logger as logger2 } from "storybook/internal/node-logger";
|
| 18 |
+
|
| 19 |
+
// ../../core/src/shared/utils/module.ts
|
| 20 |
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
| 21 |
+
|
| 22 |
+
// ../../../node_modules/exsolve/dist/index.mjs
|
| 23 |
+
import assert from "node:assert";
|
| 24 |
+
import v8 from "node:v8";
|
| 25 |
+
import { format, inspect } from "node:util";
|
| 26 |
+
var own$1 = {}.hasOwnProperty, classRegExp = /^([A-Z][a-z\d]*)+$/, kTypes = /* @__PURE__ */ new Set([
|
| 27 |
+
"string",
|
| 28 |
+
"function",
|
| 29 |
+
"number",
|
| 30 |
+
"object",
|
| 31 |
+
"Function",
|
| 32 |
+
"Object",
|
| 33 |
+
"boolean",
|
| 34 |
+
"bigint",
|
| 35 |
+
"symbol"
|
| 36 |
+
]), messages = /* @__PURE__ */ new Map(), nodeInternalPrefix = "__node_internal_", userStackTraceLimit;
|
| 37 |
+
function formatList(array, type = "and") {
|
| 38 |
+
return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
|
| 39 |
+
}
|
| 40 |
+
function createError(sym, value, constructor) {
|
| 41 |
+
return messages.set(sym, value), makeNodeErrorWithCode(constructor, sym);
|
| 42 |
+
}
|
| 43 |
+
function makeNodeErrorWithCode(Base, key) {
|
| 44 |
+
return function(...parameters) {
|
| 45 |
+
let limit = Error.stackTraceLimit;
|
| 46 |
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = 0);
|
| 47 |
+
let error = new Base();
|
| 48 |
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = limit);
|
| 49 |
+
let message = getMessage(key, parameters, error);
|
| 50 |
+
return Object.defineProperties(error, {
|
| 51 |
+
message: {
|
| 52 |
+
value: message,
|
| 53 |
+
enumerable: !1,
|
| 54 |
+
writable: !0,
|
| 55 |
+
configurable: !0
|
| 56 |
+
},
|
| 57 |
+
toString: {
|
| 58 |
+
value() {
|
| 59 |
+
return `${this.name} [${key}]: ${this.message}`;
|
| 60 |
+
},
|
| 61 |
+
enumerable: !1,
|
| 62 |
+
writable: !0,
|
| 63 |
+
configurable: !0
|
| 64 |
+
}
|
| 65 |
+
}), captureLargerStackTrace(error), error.code = key, error;
|
| 66 |
+
};
|
| 67 |
+
}
|
| 68 |
+
function isErrorStackTraceLimitWritable() {
|
| 69 |
+
try {
|
| 70 |
+
if (v8.startupSnapshot.isBuildingSnapshot()) return !1;
|
| 71 |
+
} catch {
|
| 72 |
+
}
|
| 73 |
+
let desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
| 74 |
+
return desc === void 0 ? Object.isExtensible(Error) : own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
|
| 75 |
+
}
|
| 76 |
+
function hideStackFrames(wrappedFunction) {
|
| 77 |
+
let hidden = nodeInternalPrefix + wrappedFunction.name;
|
| 78 |
+
return Object.defineProperty(wrappedFunction, "name", { value: hidden }), wrappedFunction;
|
| 79 |
+
}
|
| 80 |
+
var captureLargerStackTrace = hideStackFrames(function(error) {
|
| 81 |
+
let stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
|
| 82 |
+
return stackTraceLimitIsWritable && (userStackTraceLimit = Error.stackTraceLimit, Error.stackTraceLimit = Number.POSITIVE_INFINITY), Error.captureStackTrace(error), stackTraceLimitIsWritable && (Error.stackTraceLimit = userStackTraceLimit), error;
|
| 83 |
+
});
|
| 84 |
+
function getMessage(key, parameters, self) {
|
| 85 |
+
let message = messages.get(key);
|
| 86 |
+
if (assert.ok(message !== void 0, "expected `message` to be found"), typeof message == "function")
|
| 87 |
+
return assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`), Reflect.apply(message, self, parameters);
|
| 88 |
+
let regex = /%[dfijoOs]/g, expectedLength = 0;
|
| 89 |
+
for (; regex.exec(message) !== null; ) expectedLength++;
|
| 90 |
+
return assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`), parameters.length === 0 ? message : (parameters.unshift(message), Reflect.apply(format, null, parameters));
|
| 91 |
+
}
|
| 92 |
+
function determineSpecificType(value) {
|
| 93 |
+
if (value == null) return String(value);
|
| 94 |
+
if (typeof value == "function" && value.name) return `function ${value.name}`;
|
| 95 |
+
if (typeof value == "object")
|
| 96 |
+
return value.constructor && value.constructor.name ? `an instance of ${value.constructor.name}` : `${inspect(value, { depth: -1 })}`;
|
| 97 |
+
let inspected = inspect(value, { colors: !1 });
|
| 98 |
+
return inspected.length > 28 && (inspected = `${inspected.slice(0, 25)}...`), `type ${typeof value} (${inspected})`;
|
| 99 |
+
}
|
| 100 |
+
var ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
|
| 101 |
+
assert.ok(typeof name == "string", "'name' must be a string"), Array.isArray(expected) || (expected = [expected]);
|
| 102 |
+
let message = "The ";
|
| 103 |
+
if (name.endsWith(" argument")) message += `${name} `;
|
| 104 |
+
else {
|
| 105 |
+
let type = name.includes(".") ? "property" : "argument";
|
| 106 |
+
message += `"${name}" ${type} `;
|
| 107 |
+
}
|
| 108 |
+
message += "must be ";
|
| 109 |
+
let types = [], instances = [], other = [];
|
| 110 |
+
for (let value of expected)
|
| 111 |
+
assert.ok(typeof value == "string", "All expected entries have to be of type string"), kTypes.has(value) ? types.push(value.toLowerCase()) : classRegExp.exec(value) === null ? (assert.ok(value !== "object", 'The value "object" should be written as "Object"'), other.push(value)) : instances.push(value);
|
| 112 |
+
if (instances.length > 0) {
|
| 113 |
+
let pos = types.indexOf("object");
|
| 114 |
+
pos !== -1 && (types.slice(pos, 1), instances.push("Object"));
|
| 115 |
+
}
|
| 116 |
+
return types.length > 0 && (message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`, (instances.length > 0 || other.length > 0) && (message += " or ")), instances.length > 0 && (message += `an instance of ${formatList(instances, "or")}`, other.length > 0 && (message += " or ")), other.length > 0 && (other.length > 1 ? message += `one of ${formatList(other, "or")}` : (other[0]?.toLowerCase() !== other[0] && (message += "an "), message += `${other[0]}`)), message += `. Received ${determineSpecificType(actual)}`, message;
|
| 117 |
+
}, TypeError), ERR_INVALID_MODULE_SPECIFIER = createError(
|
| 118 |
+
"ERR_INVALID_MODULE_SPECIFIER",
|
| 119 |
+
/**
|
| 120 |
+
* @param {string} request
|
| 121 |
+
* @param {string} reason
|
| 122 |
+
* @param {string} [base]
|
| 123 |
+
*/
|
| 124 |
+
(request, reason, base) => `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`,
|
| 125 |
+
TypeError
|
| 126 |
+
), ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path$1, base, message) => `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`, Error), ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = !1, base) => {
|
| 127 |
+
let relatedError = typeof target == "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
| 128 |
+
return key === "." ? (assert.ok(isImport === !1), `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`) : `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
|
| 129 |
+
}, Error), ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path$1, base, exactUrl = !1) => `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`, Error), ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error), ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`, TypeError), ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
|
| 130 |
+
"ERR_PACKAGE_PATH_NOT_EXPORTED",
|
| 131 |
+
/**
|
| 132 |
+
* @param {string} packagePath
|
| 133 |
+
* @param {string} subpath
|
| 134 |
+
* @param {string} [base]
|
| 135 |
+
*/
|
| 136 |
+
(packagePath, subpath, base) => subpath === "." ? `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}` : `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`,
|
| 137 |
+
Error
|
| 138 |
+
), ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error), ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError), ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path$1) => `Unknown file extension "${extension}" for ${path$1}`, TypeError), ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
|
| 139 |
+
let inspected = inspect(value);
|
| 140 |
+
return inspected.length > 128 && (inspected = `${inspected.slice(0, 128)}...`), `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
|
| 141 |
+
}, TypeError), hasOwnProperty$1 = {}.hasOwnProperty;
|
| 142 |
+
var hasOwnProperty = {}.hasOwnProperty;
|
| 143 |
+
var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace], own = {}.hasOwnProperty;
|
| 144 |
+
var isWindows = process.platform === "win32", globalCache = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
|
| 145 |
+
|
| 146 |
+
// ../../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
| 147 |
+
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
| 148 |
+
function normalizeWindowsPath(input = "") {
|
| 149 |
+
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
| 150 |
+
}
|
| 151 |
+
var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
| 152 |
+
var normalize = function(path3) {
|
| 153 |
+
if (path3.length === 0)
|
| 154 |
+
return ".";
|
| 155 |
+
path3 = normalizeWindowsPath(path3);
|
| 156 |
+
let isUNCPath = path3.match(_UNC_REGEX), isPathAbsolute = isAbsolute(path3), trailingSeparator = path3[path3.length - 1] === "/";
|
| 157 |
+
return path3 = normalizeString(path3, !isPathAbsolute), path3.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path3 += "/"), _DRIVE_LETTER_RE.test(path3) && (path3 += "/"), isUNCPath ? isPathAbsolute ? `//${path3}` : `//./${path3}` : isPathAbsolute && !isAbsolute(path3) ? `/${path3}` : path3);
|
| 158 |
+
}, join = function(...arguments_) {
|
| 159 |
+
if (arguments_.length === 0)
|
| 160 |
+
return ".";
|
| 161 |
+
let joined;
|
| 162 |
+
for (let argument of arguments_)
|
| 163 |
+
argument && argument.length > 0 && (joined === void 0 ? joined = argument : joined += `/${argument}`);
|
| 164 |
+
return joined === void 0 ? "." : normalize(joined.replace(/\/\/+/g, "/"));
|
| 165 |
+
};
|
| 166 |
+
function normalizeString(path3, allowAboveRoot) {
|
| 167 |
+
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
|
| 168 |
+
for (let index = 0; index <= path3.length; ++index) {
|
| 169 |
+
if (index < path3.length)
|
| 170 |
+
char = path3[index];
|
| 171 |
+
else {
|
| 172 |
+
if (char === "/")
|
| 173 |
+
break;
|
| 174 |
+
char = "/";
|
| 175 |
+
}
|
| 176 |
+
if (char === "/") {
|
| 177 |
+
if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
|
| 178 |
+
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
| 179 |
+
if (res.length > 2) {
|
| 180 |
+
let lastSlashIndex = res.lastIndexOf("/");
|
| 181 |
+
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
|
| 182 |
+
continue;
|
| 183 |
+
} else if (res.length > 0) {
|
| 184 |
+
res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
|
| 185 |
+
continue;
|
| 186 |
+
}
|
| 187 |
+
}
|
| 188 |
+
allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
|
| 189 |
+
} else
|
| 190 |
+
res.length > 0 ? res += `/${path3.slice(lastSlash + 1, index)}` : res = path3.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
|
| 191 |
+
lastSlash = index, dots = 0;
|
| 192 |
+
} else char === "." && dots !== -1 ? ++dots : dots = -1;
|
| 193 |
+
}
|
| 194 |
+
return res;
|
| 195 |
+
}
|
| 196 |
+
var isAbsolute = function(p) {
|
| 197 |
+
return _IS_ABSOLUTE_RE.test(p);
|
| 198 |
+
};
|
| 199 |
+
var dirname = function(p) {
|
| 200 |
+
let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
| 201 |
+
return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
| 202 |
+
};
|
| 203 |
+
|
| 204 |
+
// ../../core/src/shared/utils/module.ts
|
| 205 |
+
var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
|
| 206 |
+
"importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
|
| 207 |
+
), pathToFileURL(args[0]).href) : import.meta.resolve(...args), resolvePackageDir = (pkg, parent) => {
|
| 208 |
+
try {
|
| 209 |
+
return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"), parent)));
|
| 210 |
+
} catch {
|
| 211 |
+
return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"))));
|
| 212 |
+
}
|
| 213 |
+
};
|
| 214 |
+
|
| 215 |
+
// src/manifest.ts
|
| 216 |
+
import * as fs from "node:fs/promises";
|
| 217 |
+
import * as path2 from "node:path";
|
| 218 |
+
import { groupBy } from "storybook/internal/common";
|
| 219 |
+
import { Tag, analyzeMdx } from "storybook/internal/core-server";
|
| 220 |
+
import { logger } from "storybook/internal/node-logger";
|
| 221 |
+
async function createDocsManifestEntry(entry) {
|
| 222 |
+
let absolutePath = path2.join(process.cwd(), entry.importPath);
|
| 223 |
+
try {
|
| 224 |
+
let content = await fs.readFile(absolutePath, "utf-8"), { summary } = await analyzeMdx(content);
|
| 225 |
+
return {
|
| 226 |
+
id: entry.id,
|
| 227 |
+
name: entry.name,
|
| 228 |
+
path: entry.importPath,
|
| 229 |
+
title: entry.title,
|
| 230 |
+
content,
|
| 231 |
+
...summary && { summary }
|
| 232 |
+
};
|
| 233 |
+
} catch (err) {
|
| 234 |
+
return {
|
| 235 |
+
id: entry.id,
|
| 236 |
+
name: entry.name,
|
| 237 |
+
path: entry.importPath,
|
| 238 |
+
title: entry.title,
|
| 239 |
+
error: {
|
| 240 |
+
name: err instanceof Error ? err.name : "Error",
|
| 241 |
+
message: err instanceof Error ? err.message : String(err)
|
| 242 |
+
}
|
| 243 |
+
};
|
| 244 |
+
}
|
| 245 |
+
}
|
| 246 |
+
async function extractUnattachedDocsEntries(entries) {
|
| 247 |
+
if (entries.length === 0)
|
| 248 |
+
return {};
|
| 249 |
+
let entriesWithContent = await Promise.all(entries.map(createDocsManifestEntry));
|
| 250 |
+
return Object.fromEntries(entriesWithContent.map((entry) => [entry.id, entry]));
|
| 251 |
+
}
|
| 252 |
+
async function extractAttachedDocsEntries(entries, existingComponents) {
|
| 253 |
+
if (!existingComponents || entries.length === 0)
|
| 254 |
+
return existingComponents;
|
| 255 |
+
let entriesWithContent = await Promise.all(entries.map(createDocsManifestEntry));
|
| 256 |
+
for (let docsEntry of entriesWithContent) {
|
| 257 |
+
let componentId = docsEntry.id.split("--")[0], component = existingComponents.components[componentId];
|
| 258 |
+
component && (component.docs || (component.docs = {}), component.docs[docsEntry.id] = docsEntry);
|
| 259 |
+
}
|
| 260 |
+
return existingComponents;
|
| 261 |
+
}
|
| 262 |
+
var manifests = async (existingManifests = {}, { manifestEntries }) => {
|
| 263 |
+
let startPerformance = performance.now(), docsEntries = manifestEntries.filter(
|
| 264 |
+
(entry) => entry.type === "docs"
|
| 265 |
+
);
|
| 266 |
+
if (docsEntries.length === 0)
|
| 267 |
+
return existingManifests;
|
| 268 |
+
let { attachedEntries = [], unattachedEntries = [] } = groupBy(docsEntries, (entry) => {
|
| 269 |
+
switch (!0) {
|
| 270 |
+
case entry.tags?.includes(Tag.UNATTACHED_MDX):
|
| 271 |
+
return "unattachedEntries";
|
| 272 |
+
case entry.tags?.includes(Tag.ATTACHED_MDX):
|
| 273 |
+
return "attachedEntries";
|
| 274 |
+
default:
|
| 275 |
+
return "ignored";
|
| 276 |
+
}
|
| 277 |
+
});
|
| 278 |
+
if (unattachedEntries.length === 0 && attachedEntries.length === 0)
|
| 279 |
+
return existingManifests;
|
| 280 |
+
let existingManifestsWithDocs = existingManifests, [unattachedDocs, updatedComponents] = await Promise.all([
|
| 281 |
+
extractUnattachedDocsEntries(unattachedEntries),
|
| 282 |
+
extractAttachedDocsEntries(attachedEntries, existingManifestsWithDocs.components)
|
| 283 |
+
]), processedCount = unattachedEntries.length + attachedEntries.length;
|
| 284 |
+
logger.verbose(
|
| 285 |
+
`Docs manifest generation took ${performance.now() - startPerformance}ms for ${processedCount} entries (${unattachedEntries.length} unattached, ${attachedEntries.length} attached)`
|
| 286 |
+
);
|
| 287 |
+
let result = { ...existingManifestsWithDocs };
|
| 288 |
+
return Object.keys(unattachedDocs).length > 0 && (result.docs = {
|
| 289 |
+
v: 0,
|
| 290 |
+
docs: unattachedDocs
|
| 291 |
+
}), updatedComponents && (result.components = updatedComponents), result;
|
| 292 |
+
};
|
| 293 |
+
|
| 294 |
+
// src/preset.ts
|
| 295 |
+
var getResolvedReact = async (options) => {
|
| 296 |
+
let resolvedReact2 = await options.presets.apply("resolvedReact", {});
|
| 297 |
+
return {
|
| 298 |
+
react: resolvedReact2.react ?? resolvePackageDir("react"),
|
| 299 |
+
reactDom: resolvedReact2.reactDom ?? resolvePackageDir("react-dom"),
|
| 300 |
+
// In Webpack, symlinked MDX files will cause @mdx-js/react to not be resolvable if it is not hoisted
|
| 301 |
+
// This happens for the SB monorepo's template stories when a sandbox has a different react version than
|
| 302 |
+
// addon-docs, causing addon-docs's dependencies not to be hoisted.
|
| 303 |
+
// This might also affect regular users who have a similar setup.
|
| 304 |
+
// Explicitly alias @mdx-js/react to avoid this issue.
|
| 305 |
+
mdx: resolvedReact2.mdx ?? fileURLToPath2(import.meta.resolve("@mdx-js/react"))
|
| 306 |
+
};
|
| 307 |
+
};
|
| 308 |
+
async function webpack(webpackConfig = {}, options) {
|
| 309 |
+
let { module = {} } = webpackConfig, { csfPluginOptions = {}, mdxPluginOptions = {} } = options, enrichCsf = await options.presets.apply("experimental_enrichCsf"), rehypeSlug = (await import("./_node-chunks/rehype-slug-QMVSHJMP.js")).default, rehypeExternalLinks = (await import("./_node-chunks/rehype-external-links-B457SAPO.js")).default, mdxLoaderOptions = await options.presets.apply("mdxLoaderOptions", {
|
| 310 |
+
...mdxPluginOptions,
|
| 311 |
+
mdxCompileOptions: {
|
| 312 |
+
providerImportSource: import.meta.resolve("@storybook/addon-docs/mdx-react-shim"),
|
| 313 |
+
...mdxPluginOptions.mdxCompileOptions,
|
| 314 |
+
rehypePlugins: [
|
| 315 |
+
...mdxPluginOptions?.mdxCompileOptions?.rehypePlugins ?? [],
|
| 316 |
+
rehypeSlug,
|
| 317 |
+
rehypeExternalLinks
|
| 318 |
+
]
|
| 319 |
+
}
|
| 320 |
+
});
|
| 321 |
+
logger2.info("Addon-docs: using MDX3");
|
| 322 |
+
let { react, reactDom, mdx } = await getResolvedReact(options), alias;
|
| 323 |
+
return Array.isArray(webpackConfig.resolve?.alias) ? (alias = [...webpackConfig.resolve?.alias], alias.push(
|
| 324 |
+
{
|
| 325 |
+
name: "react",
|
| 326 |
+
alias: react
|
| 327 |
+
},
|
| 328 |
+
{
|
| 329 |
+
name: "react-dom",
|
| 330 |
+
alias: reactDom
|
| 331 |
+
},
|
| 332 |
+
{
|
| 333 |
+
name: "@mdx-js/react",
|
| 334 |
+
alias: mdx
|
| 335 |
+
}
|
| 336 |
+
)) : alias = {
|
| 337 |
+
...webpackConfig.resolve?.alias,
|
| 338 |
+
react,
|
| 339 |
+
"react-dom": reactDom,
|
| 340 |
+
"@mdx-js/react": mdx
|
| 341 |
+
}, {
|
| 342 |
+
...webpackConfig,
|
| 343 |
+
plugins: [
|
| 344 |
+
...webpackConfig.plugins || [],
|
| 345 |
+
...csfPluginOptions ? [
|
| 346 |
+
(await import("@storybook/csf-plugin")).webpack({
|
| 347 |
+
...csfPluginOptions,
|
| 348 |
+
enrichCsf
|
| 349 |
+
})
|
| 350 |
+
] : []
|
| 351 |
+
],
|
| 352 |
+
resolve: {
|
| 353 |
+
...webpackConfig.resolve,
|
| 354 |
+
alias
|
| 355 |
+
},
|
| 356 |
+
module: {
|
| 357 |
+
...module,
|
| 358 |
+
rules: [
|
| 359 |
+
...module.rules || [],
|
| 360 |
+
{
|
| 361 |
+
test: /\.mdx$/,
|
| 362 |
+
exclude: /(stories|story)\.mdx$/,
|
| 363 |
+
use: [
|
| 364 |
+
{
|
| 365 |
+
loader: fileURLToPath2(import.meta.resolve("@storybook/addon-docs/mdx-loader")),
|
| 366 |
+
options: mdxLoaderOptions
|
| 367 |
+
}
|
| 368 |
+
]
|
| 369 |
+
}
|
| 370 |
+
]
|
| 371 |
+
}
|
| 372 |
+
};
|
| 373 |
+
}
|
| 374 |
+
var docs = (input = {}, options) => {
|
| 375 |
+
if (options?.build?.test?.disableAutoDocs)
|
| 376 |
+
return;
|
| 377 |
+
let result = {
|
| 378 |
+
...input,
|
| 379 |
+
defaultName: "Docs"
|
| 380 |
+
}, docsMode = options.docs;
|
| 381 |
+
return docsMode && (result.docsMode = docsMode), result;
|
| 382 |
+
}, addons = [
|
| 383 |
+
import.meta.resolve("@storybook/react-dom-shim/preset")
|
| 384 |
+
], viteFinal = async (config, options) => {
|
| 385 |
+
let { plugins = [] } = config, { mdxPlugin } = await import("./_node-chunks/mdx-plugin-P3ASKRBX.js"), { react, reactDom, mdx } = await getResolvedReact(options), packageDeduplicationPlugin = {
|
| 386 |
+
name: "storybook:package-deduplication",
|
| 387 |
+
enforce: "pre",
|
| 388 |
+
config: () => ({
|
| 389 |
+
resolve: {
|
| 390 |
+
alias: {
|
| 391 |
+
react,
|
| 392 |
+
// Vite doesn't respect export maps when resolving an absolute path, so we need to do that manually here
|
| 393 |
+
...isAbsolute2(reactDom) && { "react-dom/server": `${reactDom}/server.browser.js` },
|
| 394 |
+
"react-dom": reactDom,
|
| 395 |
+
"@mdx-js/react": mdx
|
| 396 |
+
}
|
| 397 |
+
}
|
| 398 |
+
})
|
| 399 |
+
};
|
| 400 |
+
return plugins.unshift(packageDeduplicationPlugin), plugins.unshift(mdxPlugin(options)), {
|
| 401 |
+
...config,
|
| 402 |
+
plugins
|
| 403 |
+
};
|
| 404 |
+
}, webpackX = webpack, docsX = docs, resolvedReact = async (existing) => ({
|
| 405 |
+
react: existing?.react ?? resolvePackageDir("react"),
|
| 406 |
+
reactDom: existing?.reactDom ?? resolvePackageDir("react-dom"),
|
| 407 |
+
mdx: existing?.mdx ?? fileURLToPath2(import.meta.resolve("@mdx-js/react"))
|
| 408 |
+
}), optimizeViteDeps = [
|
| 409 |
+
"@storybook/addon-docs",
|
| 410 |
+
"@storybook/addon-docs/blocks",
|
| 411 |
+
"@storybook/addon-docs > @mdx-js/react"
|
| 412 |
+
];
|
| 413 |
+
export {
|
| 414 |
+
addons,
|
| 415 |
+
docsX as docs,
|
| 416 |
+
manifests as experimental_manifests,
|
| 417 |
+
optimizeViteDeps,
|
| 418 |
+
resolvedReact,
|
| 419 |
+
viteFinal,
|
| 420 |
+
webpackX as webpack
|
| 421 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/preview.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
declare const parameters: any;
|
| 2 |
+
|
| 3 |
+
export { parameters };
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/preview.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import {
|
| 2 |
+
parameters
|
| 3 |
+
} from "./_browser-chunks/chunk-S4QKU6I5.js";
|
| 4 |
+
import "./_browser-chunks/chunk-SL3VIQZ3.js";
|
| 5 |
+
export {
|
| 6 |
+
parameters
|
| 7 |
+
};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/web-components/index.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
export { }
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-docs/dist/web-components/index.js
ADDED
|
File without changes
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2021 Storybook contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/README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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Svelte CSF
|
| 2 |
+
|
| 3 |
+
This Storybook addon allows you to write Storybook stories using the Svelte language instead of ESM that regular CSF is based on.
|
| 4 |
+
|
| 5 |
+
```bash
|
| 6 |
+
npx storybook@latest add @storybook/addon-svelte-csf
|
| 7 |
+
```
|
| 8 |
+
|
| 9 |
+
Using the Svelte language makes it easier to write stories for composed components that rely on snippets or slots, which aren't easily re-created outside of Svelte files.
|
| 10 |
+
|
| 11 |
+
## 🐣 Getting Started
|
| 12 |
+
|
| 13 |
+
> [!TIP]
|
| 14 |
+
> If you've initialized your Storybook project with Storybook version 8.2.0 or above, this addon is already set up for you!
|
| 15 |
+
|
| 16 |
+
> [!IMPORTANT]
|
| 17 |
+
> Not running the latest and greatest versions of Storybook or Svelte? Be sure to check [the version compatibility section below](#version-compatibility).
|
| 18 |
+
|
| 19 |
+
The easiest way to install the addon is with `storybook add`:
|
| 20 |
+
|
| 21 |
+
```bash
|
| 22 |
+
npx storybook@latest add @storybook/addon-svelte-csf
|
| 23 |
+
```
|
| 24 |
+
|
| 25 |
+
You can also add the addon manually. First, install the package:
|
| 26 |
+
|
| 27 |
+
```bash
|
| 28 |
+
npm install --save-dev @storybook/addon-svelte-csf
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
Then modify your `main.ts` Storybook configuration to include the addon and include `*.stories.svelte` files:
|
| 32 |
+
|
| 33 |
+
```diff
|
| 34 |
+
export default {
|
| 35 |
+
- stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
|
| 36 |
+
+ stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx|svelte)'],
|
| 37 |
+
addons: [
|
| 38 |
+
+ '@storybook/addon-svelte-csf',
|
| 39 |
+
...
|
| 40 |
+
],
|
| 41 |
+
...
|
| 42 |
+
}
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
Restart your Storybook server for the changes to take effect.
|
| 46 |
+
|
| 47 |
+
## 🐓 Usage
|
| 48 |
+
|
| 49 |
+
> [!NOTE]
|
| 50 |
+
> The documentation here does not cover all of Storybook's features, only the aspects that are specific to the addon and Svelte CSF. We recommend that you familiarize yourself with Storybook's core concepts at <https://storybook.js.org/docs>.
|
| 51 |
+
|
| 52 |
+
The [`examples`](./examples/) directory contains examples describing each feature of the addon. The [`Button.stories.svelte` example](./examples/Button.stories.svelte) is a good one to get started with. [The Storybook with all the examples is published on Chromatic here](https://next--667492d3e52064f1d418ec95.chromatic.com).
|
| 53 |
+
|
| 54 |
+
Svelte CSF stories files must always have the `.stories.svelte` extension.
|
| 55 |
+
|
| 56 |
+
### Defining the meta
|
| 57 |
+
|
| 58 |
+
All stories files must have a "meta" (aka. "default export") defined, and its structure follows what's described in [the official docs on the subject](https://storybook.js.org/docs/api/csf#default-export). To define the meta in Svelte CSF, call the `defineMeta` function **within the module context**, with the meta properties you want:
|
| 59 |
+
|
| 60 |
+
```svelte
|
| 61 |
+
<script module>
|
| 62 |
+
// 👆 notice the module context, defineMeta does not work in a regular <script> tag - instance
|
| 63 |
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
| 64 |
+
|
| 65 |
+
import MyComponent from './MyComponent.svelte';
|
| 66 |
+
|
| 67 |
+
// 👇 Get the Story component from the return value
|
| 68 |
+
const { Story } = defineMeta({
|
| 69 |
+
title: 'Path/To/MyComponent',
|
| 70 |
+
component: MyComponent,
|
| 71 |
+
decorators: [
|
| 72 |
+
/* ... */
|
| 73 |
+
],
|
| 74 |
+
parameters: {
|
| 75 |
+
/* ... */
|
| 76 |
+
},
|
| 77 |
+
});
|
| 78 |
+
</script>
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
`defineMeta` returns an object with a `Story` component (see [Defining stories](#defining-stories) below) that you must destructure out to use.
|
| 82 |
+
|
| 83 |
+
### Defining stories
|
| 84 |
+
|
| 85 |
+
To define stories, you use the `Story` component returned from the `defineMeta` function. Depending on what you want the story to contain, [there are multiple ways to use the `Story` component](./examples/Templating.stories.svelte). Common for all the use case is that all properties of [a regular CSF story](https://storybook.js.org/docs/api/csf#named-story-exports) are passed as props to the `Story` component, with the exception of the `render` function, which does not have any effect in Svelte CSF.
|
| 86 |
+
|
| 87 |
+
All story requires either the `name` prop or [`exportName` prop](#custom-export-name).
|
| 88 |
+
|
| 89 |
+
> [!TIP]
|
| 90 |
+
> In versions prior to v5 of this addon, it was always required to define a template story with the `<Template>` component. This is no longer required and stories will default to render the component from `meta` if no template is set.
|
| 91 |
+
|
| 92 |
+
#### Plain Story
|
| 93 |
+
|
| 94 |
+
If your component only accepts props and doesn't require snippets or slots, you can use the simple form of defining stories, only using args:
|
| 95 |
+
|
| 96 |
+
```svelte
|
| 97 |
+
<Story name="Primary" args={{ primary: true }} />
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
This will render the component defined in the meta, with the args passed as props.
|
| 101 |
+
|
| 102 |
+
#### With children
|
| 103 |
+
|
| 104 |
+
If your component needs children, you can pass them in directly to the story, and they will be forwarded to your component:
|
| 105 |
+
|
| 106 |
+
```svelte
|
| 107 |
+
<Story name="With Children">I will be the child of the component from defineMeta</Story>
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
#### Static template
|
| 111 |
+
|
| 112 |
+
If you need more customization of the story, like composing components or defining snippets, you can set the `asChild` prop on the Story. Instead of forwarding the children to your component, it will instead use the children directly as the story output. This allows you to write whatever component structure you desire:
|
| 113 |
+
|
| 114 |
+
```svelte
|
| 115 |
+
<Story name="Composed" asChild>
|
| 116 |
+
<MyComponent>
|
| 117 |
+
<AChild label="Hello world!" />
|
| 118 |
+
</MyComponent>
|
| 119 |
+
</Story>
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
> [!IMPORTANT]
|
| 123 |
+
> This format completely ignores args, as they are not passed down to any of the child components defined. Even if your story has args and Controls, they won't have an effect. See the snippet-based formats below.
|
| 124 |
+
|
| 125 |
+
#### Inline snippet
|
| 126 |
+
|
| 127 |
+
If you need composition/snippets but also want a dynamic story that reacts to args or the story context, you can define a `template` snippet in the `Story` component:
|
| 128 |
+
|
| 129 |
+
```svelte
|
| 130 |
+
<Story name="Simple Template" args={{ simpleChild: true }}>
|
| 131 |
+
{#snippet template(args)}
|
| 132 |
+
<MyComponent {...args}>Component with args</MyComponent>
|
| 133 |
+
{/snippet}
|
| 134 |
+
</Story>
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
#### Shared snippet
|
| 138 |
+
|
| 139 |
+
Often your stories are very similar and their only differences are args or play-functions. In this case it can be cumbersome to define the same `template` snippet over and over again. You can share snippets by defining them at the top-level and passing them as props to `Story`:
|
| 140 |
+
|
| 141 |
+
```svelte
|
| 142 |
+
{#snippet template(args)}
|
| 143 |
+
<MyComponent {...args}>
|
| 144 |
+
{#if args.simpleChild}
|
| 145 |
+
<AChild data={args.childProps} />
|
| 146 |
+
{:else}
|
| 147 |
+
<ComplexChildA data={args.childProps} />
|
| 148 |
+
<ComplexChildB data={args.childProps} />
|
| 149 |
+
{/if}
|
| 150 |
+
</MyComponent>
|
| 151 |
+
{/snippet}
|
| 152 |
+
|
| 153 |
+
<Story name="Simple Template" args={{ simpleChild: true }} {template} />
|
| 154 |
+
|
| 155 |
+
<Story name="Complex Template" args={{ simpleChild: false }} {template} />
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
+
You can also use this pattern to define multiple templates and share the different templates among different stories.
|
| 159 |
+
|
| 160 |
+
#### Default snippet
|
| 161 |
+
|
| 162 |
+
If you only need a single template that you want to share, it can be tedious to include `{template}` in each `Story` component. Like in th example below:
|
| 163 |
+
|
| 164 |
+
```svelte
|
| 165 |
+
<Story name="Primary" args={{ variant: 'primary' }} {template} />
|
| 166 |
+
<Story name="Secondary" args={{ variant: 'secondary' }} {template} />
|
| 167 |
+
<Story name="Tertiary" args={{ variant: 'tertiary' }} {template} />
|
| 168 |
+
<!-- ... more ... -->
|
| 169 |
+
<Story name="Denary" args={{ variant: 'denary' }} {template} />
|
| 170 |
+
```
|
| 171 |
+
|
| 172 |
+
Similar to regular CSF, you can define a meta-level `render`-function, by referencing your default snippet in the `render` property of your `defineMeta` call:
|
| 173 |
+
|
| 174 |
+
```svelte
|
| 175 |
+
<script module>
|
| 176 |
+
import { defineMeta } from '@storybook/addon-svelte-csf';
|
| 177 |
+
import MyComponent from './MyComponent.svelte';
|
| 178 |
+
|
| 179 |
+
const { Story } = defineMeta({
|
| 180 |
+
render: template,
|
| 181 |
+
// 👆 the name of the snippet as defined below (can be any name)
|
| 182 |
+
});
|
| 183 |
+
</script>
|
| 184 |
+
|
| 185 |
+
{#snippet template(args)}
|
| 186 |
+
<MyComponent {...args}>
|
| 187 |
+
{#if args.simpleChild}
|
| 188 |
+
<AChild data={args.childProps} />
|
| 189 |
+
{:else}
|
| 190 |
+
<ComplexChildA data={args.childProps} />
|
| 191 |
+
<ComplexChildB data={args.childProps} />
|
| 192 |
+
{/if}
|
| 193 |
+
</MyComponent>
|
| 194 |
+
{/snippet}
|
| 195 |
+
|
| 196 |
+
<Story name="Simple Children" args={{ simpleChild: true }} />
|
| 197 |
+
|
| 198 |
+
<Story name="Complex Children" args={{ simpleChild: false }} />
|
| 199 |
+
```
|
| 200 |
+
|
| 201 |
+
Stories can still override this default snippet using any of the methods for defining story-level content.
|
| 202 |
+
|
| 203 |
+
> [!NOTE]
|
| 204 |
+
> Svelte has the limitation, that you can't reference a snippet from a `<script module>` if it reference any declarations in a non-module `<script>` (whether directly or indirectly, via other snippets). See [svelte.dev/docs/svelte/snippet#Exporting-snippets](https://svelte.dev/docs/svelte/snippet#Exporting-snippets)
|
| 205 |
+
|
| 206 |
+
#### Custom export name
|
| 207 |
+
|
| 208 |
+
Behind-the-scenes, each `<Story />` definition is compiled to a variable export like `export const MyStory = ...;`. In most cases you don't have to care about this detail, however sometimes naming conflicts can arise from this. The variable names are simplifications of the story names - to make them valid JavaScript variables.
|
| 209 |
+
|
| 210 |
+
This can cause conflicts, eg. two stories with the names _"my story!"_ and _"My Story"_ will both be simplified to `MyStory`.
|
| 211 |
+
|
| 212 |
+
You can explicitly define the variable name of any story by passing the `exportName` prop:
|
| 213 |
+
|
| 214 |
+
```svelte
|
| 215 |
+
<Story exportName="MyStory1" name="my story!" />
|
| 216 |
+
<Story exportName="MyStory2" name="My Story" />
|
| 217 |
+
```
|
| 218 |
+
|
| 219 |
+
At least one of the `name` or `exportName` props must be passed to the `Story` component - passing both is also valid.
|
| 220 |
+
|
| 221 |
+
#### Accessing Story context
|
| 222 |
+
|
| 223 |
+
If for some reason you need to access the [Story context](https://storybook.js.org/docs/writing-stories/decorators#context-for-mocking) _(e.g. for mocking)_ while rendering the story, then `<Story />`'s attribute `template` snippet provides an optional second argument.
|
| 224 |
+
|
| 225 |
+
```svelte
|
| 226 |
+
<Story name="Default">
|
| 227 |
+
{#snippet template(args, context)}
|
| 228 |
+
<!-- 👆 use the optional second argument to access Story context -->
|
| 229 |
+
<MyComponent {...args}>
|
| 230 |
+
{/snippet}
|
| 231 |
+
</Story>
|
| 232 |
+
```
|
| 233 |
+
|
| 234 |
+
### TypeScript
|
| 235 |
+
|
| 236 |
+
Story template snippets can be type-safe when necessary. The type of the args are inferred from the `component` or `render` property passed to `defineMeta`.
|
| 237 |
+
|
| 238 |
+
If you're just rendering the component directly without a custom template, you can use Svelte's `ComponentProps` type and `StoryContext` from the addon to make your template snippet type-safe:
|
| 239 |
+
|
| 240 |
+
```svelte
|
| 241 |
+
<script module lang="ts">
|
| 242 |
+
import { defineMeta, type StoryContext } from '@storybook/addon-svelte-csf';
|
| 243 |
+
import { type ComponentProps } from 'svelte';
|
| 244 |
+
|
| 245 |
+
import MyComponent from './MyComponent.svelte';
|
| 246 |
+
|
| 247 |
+
const { Story } = defineMeta({
|
| 248 |
+
component: MyComponent,
|
| 249 |
+
});
|
| 250 |
+
|
| 251 |
+
type Args = ComponentProps<MyComponent>;
|
| 252 |
+
</script>
|
| 253 |
+
|
| 254 |
+
{#snippet template(args: Args, context: StoryContext<typeof Layout>)}
|
| 255 |
+
<MyComponent {...args} />
|
| 256 |
+
{/snippet}
|
| 257 |
+
```
|
| 258 |
+
|
| 259 |
+
If you use the `render`-property to define a custom template that might use custom args, the args will be inferred from the types of the snippet passed to `render`. This is especially useful when you're converting primitive args to snippets:
|
| 260 |
+
|
| 261 |
+
```svelte
|
| 262 |
+
<script module lang="ts">
|
| 263 |
+
import { defineMeta, type StoryContext } from '@storybook/addon-svelte-csf';
|
| 264 |
+
import { type ComponentProps } from 'svelte';
|
| 265 |
+
|
| 266 |
+
import MyComponent from './MyComponent.svelte';
|
| 267 |
+
|
| 268 |
+
const { Story } = defineMeta({
|
| 269 |
+
component: MyComponent,
|
| 270 |
+
render: template, // 👈 args will be inferred from this, which is the Args type below
|
| 271 |
+
argTypes: {
|
| 272 |
+
children: {
|
| 273 |
+
control: 'text',
|
| 274 |
+
},
|
| 275 |
+
footer: {
|
| 276 |
+
control: 'text',
|
| 277 |
+
},
|
| 278 |
+
},
|
| 279 |
+
});
|
| 280 |
+
|
| 281 |
+
type Args = Omit<ComponentProps<MyComponent>, 'children' | 'footer'> & {
|
| 282 |
+
children: string;
|
| 283 |
+
footer?: string;
|
| 284 |
+
};
|
| 285 |
+
// OR use the Merge helper from the 'type-fest' package:
|
| 286 |
+
type Args = Merge<
|
| 287 |
+
ComponentProps<MyComponent>,
|
| 288 |
+
{
|
| 289 |
+
children: string;
|
| 290 |
+
footer?: string;
|
| 291 |
+
}
|
| 292 |
+
>;
|
| 293 |
+
</script>
|
| 294 |
+
|
| 295 |
+
<!-- 👇 you need to omit 'children' from args to satisfy Svelte's constraints -->
|
| 296 |
+
{#snippet template({ children, ...args }: Args, context: StoryContext<typeof MyComponent>)}
|
| 297 |
+
<MyComponent {...args}>
|
| 298 |
+
{children}
|
| 299 |
+
{#snippet footer()}
|
| 300 |
+
{args.footer}
|
| 301 |
+
{/snippet}
|
| 302 |
+
</MyComponent>
|
| 303 |
+
{/snippet}
|
| 304 |
+
```
|
| 305 |
+
|
| 306 |
+
See [the `Types.stories.svelte` examples](./examples/Types.stories.svelte) on how to use complex types properly.
|
| 307 |
+
|
| 308 |
+
### Legacy API
|
| 309 |
+
|
| 310 |
+
Version 5 of the addon changes the API from v4 in key areas, as described above. However a feature flag has been introduced to maintain support for the `<Template>`-based legacy API as it was prior to v5.
|
| 311 |
+
|
| 312 |
+
To enable supoprt for the legacy API, make the following change to your main Storybook config:
|
| 313 |
+
|
| 314 |
+
```diff
|
| 315 |
+
export default {
|
| 316 |
+
addons: [
|
| 317 |
+
- '@storybook/addon-svelte-csf',
|
| 318 |
+
+ {
|
| 319 |
+
+ name: '@storybook/addon-svelte-csf',
|
| 320 |
+
+ options: {
|
| 321 |
+
+ legacyTemplate: true
|
| 322 |
+
+ },
|
| 323 |
+
...
|
| 324 |
+
],
|
| 325 |
+
...
|
| 326 |
+
}
|
| 327 |
+
```
|
| 328 |
+
|
| 329 |
+
This can make the overall experience slower, because it adds more transformation steps on top of the existing ones. It should only be used temporarily while migrating to the new API. It's highly likely that the legacy support will be dropped in future major versions of the addon.
|
| 330 |
+
|
| 331 |
+
The legacy support is not bullet-proof, and it might not work in all scenarios that previously worked. If you're experiencing issues or getting errors after upgrading to v5, try migrating the problematic stories files to the modern API.
|
| 332 |
+
|
| 333 |
+
## Version compatibility
|
| 334 |
+
|
| 335 |
+
### latest
|
| 336 |
+
|
| 337 |
+
Version 5 and up of this addon requires _at least_:
|
| 338 |
+
|
| 339 |
+
| Dependency | Version |
|
| 340 |
+
| ---------------------------------------------------------------------------------------------------------------------- | -------- |
|
| 341 |
+
| [Storybook](https://github.com/storybookjs/storybook) | `v8.0.0` |
|
| 342 |
+
| [Svelte](https://github.com/sveltejs/svelte) | `v5.0.0` |
|
| 343 |
+
| [Vite](https://github.com/vitejs/vite) | `v5.0.0` |
|
| 344 |
+
| [`@sveltejs/vite-plugin-svelte`](https://github.com/sveltejs/vite-plugin-svelte/tree/main/packages/vite-plugin-svelte) | `v4.0.0` |
|
| 345 |
+
|
| 346 |
+
> [!IMPORTANT]
|
| 347 |
+
> As of `v5` this addon does not support Webpack.
|
| 348 |
+
|
| 349 |
+
### v4
|
| 350 |
+
|
| 351 |
+
```bash
|
| 352 |
+
npm install --save-dev @storybook/addon-svelte-csf@^4
|
| 353 |
+
```
|
| 354 |
+
|
| 355 |
+
Version 4 of this addon requires _at least_:
|
| 356 |
+
|
| 357 |
+
- Storybook v7
|
| 358 |
+
- Svelte v4
|
| 359 |
+
- Vite v4 (if using Vite)
|
| 360 |
+
- `@sveltejs/vite-plugin-svelte` v2 (if using Vite)
|
| 361 |
+
|
| 362 |
+
### v3
|
| 363 |
+
|
| 364 |
+
```bash
|
| 365 |
+
npm install --save-dev @storybook/addon-svelte-csf@^3
|
| 366 |
+
```
|
| 367 |
+
|
| 368 |
+
Version 3 of this addon requires _at least_:
|
| 369 |
+
|
| 370 |
+
- Storybook v7
|
| 371 |
+
- Svelte v3
|
| 372 |
+
|
| 373 |
+
### v2
|
| 374 |
+
|
| 375 |
+
```bash
|
| 376 |
+
npm install --save-dev @storybook/addon-svelte-csf@^2
|
| 377 |
+
```
|
| 378 |
+
|
| 379 |
+
If you're using Storybook between v6.4.20 and v7.0.0, you should use version `^2.0.0` of this addon.
|
| 380 |
+
|
| 381 |
+
## 🤝 Contributing
|
| 382 |
+
|
| 383 |
+
This project uses [pnpm](https://pnpm.io/installation) for dependency management.
|
| 384 |
+
|
| 385 |
+
1. Install dependencies with `pnpm install`
|
| 386 |
+
2. Concurrently start the compilation and the internal Storybook with `pnpm start`.
|
| 387 |
+
3. Restarting the internal Storybook is often needed for changes to take effect.
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/dist/compiler/plugins.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* NOTE:
|
| 3 |
+
*
|
| 4 |
+
* 1. Why Svelte AST nodes had to be included?
|
| 5 |
+
* - During the compilation from Svelte to JS, HTML comments are removed.
|
| 6 |
+
* - Rollup' internal `this.parse()` excludes `leadingComments` from parsing.
|
| 7 |
+
* I couldn't find an option to override this behavior.
|
| 8 |
+
* I wanted to avoid adding another package for parsing _(getting AST)_ - e.g. `acorn`
|
| 9 |
+
*/
|
| 10 |
+
import type { Plugin } from 'vite';
|
| 11 |
+
export declare function preTransformPlugin(): Promise<Plugin>;
|
| 12 |
+
export declare function transformPlugin(): Promise<Plugin>;
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/dist/compiler/plugins.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* NOTE:
|
| 3 |
+
*
|
| 4 |
+
* 1. Why Svelte AST nodes had to be included?
|
| 5 |
+
* - During the compilation from Svelte to JS, HTML comments are removed.
|
| 6 |
+
* - Rollup' internal `this.parse()` excludes `leadingComments` from parsing.
|
| 7 |
+
* I couldn't find an option to override this behavior.
|
| 8 |
+
* I wanted to avoid adding another package for parsing _(getting AST)_ - e.g. `acorn`
|
| 9 |
+
*/
|
| 10 |
+
import fs from 'node:fs';
|
| 11 |
+
import MagicString from 'magic-string';
|
| 12 |
+
import { preprocess } from 'svelte/compiler';
|
| 13 |
+
import { codemodLegacyNodes } from './pre-transform/index.js';
|
| 14 |
+
import { transformStoriesCode } from './post-transform/index.js';
|
| 15 |
+
import { getSvelteAST } from '../parser/ast.js';
|
| 16 |
+
import { extractCompiledASTNodes } from '../parser/extract/compiled/nodes.js';
|
| 17 |
+
import { extractSvelteASTNodes } from '../parser/extract/svelte/nodes.js';
|
| 18 |
+
export async function preTransformPlugin() {
|
| 19 |
+
const [{ createFilter }, { print }] = await Promise.all([
|
| 20 |
+
import('vite'),
|
| 21 |
+
import('svelte-ast-print'),
|
| 22 |
+
]);
|
| 23 |
+
const include = /\.stories\.svelte$/;
|
| 24 |
+
const filter = createFilter(include);
|
| 25 |
+
return {
|
| 26 |
+
name: 'storybook:addon-svelte-csf-legacy-api-support',
|
| 27 |
+
enforce: 'pre',
|
| 28 |
+
transform: {
|
| 29 |
+
order: 'pre',
|
| 30 |
+
async handler(code, id) {
|
| 31 |
+
if (!filter(id))
|
| 32 |
+
return undefined;
|
| 33 |
+
const svelteAST = getSvelteAST({ code, filename: id });
|
| 34 |
+
const transformedSvelteAST = await codemodLegacyNodes({
|
| 35 |
+
ast: svelteAST,
|
| 36 |
+
filename: id,
|
| 37 |
+
});
|
| 38 |
+
let magicCode = new MagicString(code);
|
| 39 |
+
magicCode.overwrite(0, code.length - 1, print(transformedSvelteAST));
|
| 40 |
+
const stringifiedMagicCode = magicCode.toString();
|
| 41 |
+
return {
|
| 42 |
+
code: stringifiedMagicCode,
|
| 43 |
+
map: magicCode.generateMap({ hires: true, source: id }),
|
| 44 |
+
meta: {
|
| 45 |
+
_storybook_csf_pre_transform: stringifiedMagicCode,
|
| 46 |
+
},
|
| 47 |
+
};
|
| 48 |
+
},
|
| 49 |
+
},
|
| 50 |
+
};
|
| 51 |
+
}
|
| 52 |
+
export async function transformPlugin() {
|
| 53 |
+
const [{ createFilter }, { loadSvelteConfig }] = await Promise.all([
|
| 54 |
+
import('vite'),
|
| 55 |
+
import('@sveltejs/vite-plugin-svelte'),
|
| 56 |
+
]);
|
| 57 |
+
const svelteConfig = await loadSvelteConfig();
|
| 58 |
+
const include = /\.stories\.svelte$/;
|
| 59 |
+
const filter = createFilter(include);
|
| 60 |
+
return {
|
| 61 |
+
name: 'storybook:addon-svelte-csf',
|
| 62 |
+
config() {
|
| 63 |
+
return {
|
| 64 |
+
optimizeDeps: {
|
| 65 |
+
include: ['@storybook/addon-svelte-csf/internal/create-runtime-stories'],
|
| 66 |
+
},
|
| 67 |
+
};
|
| 68 |
+
},
|
| 69 |
+
async transform(compiledCode, id) {
|
| 70 |
+
if (!filter(id))
|
| 71 |
+
return undefined;
|
| 72 |
+
const compiledAST = this.parse(compiledCode);
|
| 73 |
+
let magicCompiledCode = new MagicString(compiledCode);
|
| 74 |
+
let rawCode = this.getModuleInfo(id)?.meta._storybook_csf_pre_transform ??
|
| 75 |
+
fs.readFileSync(id).toString();
|
| 76 |
+
if (svelteConfig?.preprocess) {
|
| 77 |
+
const processed = await preprocess(rawCode, svelteConfig.preprocess, {
|
| 78 |
+
filename: id,
|
| 79 |
+
});
|
| 80 |
+
rawCode = processed.code;
|
| 81 |
+
}
|
| 82 |
+
const svelteAST = getSvelteAST({ code: rawCode, filename: id });
|
| 83 |
+
const svelteASTNodes = await extractSvelteASTNodes({
|
| 84 |
+
ast: svelteAST,
|
| 85 |
+
filename: id,
|
| 86 |
+
});
|
| 87 |
+
const compiledASTNodes = await extractCompiledASTNodes({
|
| 88 |
+
ast: compiledAST,
|
| 89 |
+
filename: id,
|
| 90 |
+
});
|
| 91 |
+
await transformStoriesCode({
|
| 92 |
+
code: magicCompiledCode,
|
| 93 |
+
nodes: {
|
| 94 |
+
svelte: svelteASTNodes,
|
| 95 |
+
compiled: compiledASTNodes,
|
| 96 |
+
},
|
| 97 |
+
filename: id,
|
| 98 |
+
originalCode: rawCode,
|
| 99 |
+
});
|
| 100 |
+
return {
|
| 101 |
+
code: magicCompiledCode.toString(),
|
| 102 |
+
map: magicCompiledCode.generateMap({ hires: true, source: id }),
|
| 103 |
+
};
|
| 104 |
+
},
|
| 105 |
+
};
|
| 106 |
+
}
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/dist/compiler/post-transform/appendix/create-export-order.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { getStoriesIdentifiers } from '../../../parser/analyse/story/attributes/identifiers.js';
|
| 2 |
+
import { type ESTreeAST } from '../../../parser/ast.js';
|
| 3 |
+
interface ExportOrderVariableDeclarationParams {
|
| 4 |
+
storiesIdentifiers: ReturnType<typeof getStoriesIdentifiers>;
|
| 5 |
+
filename?: string;
|
| 6 |
+
}
|
| 7 |
+
export declare function createExportOrderVariableDeclaration(params: ExportOrderVariableDeclarationParams): ESTreeAST.ExportNamedDeclaration;
|
| 8 |
+
export {};
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/dist/compiler/post-transform/appendix/create-export-order.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { createASTArrayExpression, createASTExportSpecifier, } from '../../../parser/ast.js';
|
| 2 |
+
export function createExportOrderVariableDeclaration(params) {
|
| 3 |
+
const { storiesIdentifiers: storyIdentifiers } = params;
|
| 4 |
+
const specifier = createASTExportSpecifier({ local: '__namedExportsOrder' });
|
| 5 |
+
return {
|
| 6 |
+
type: 'ExportNamedDeclaration',
|
| 7 |
+
specifiers: [specifier],
|
| 8 |
+
declaration: {
|
| 9 |
+
type: 'VariableDeclaration',
|
| 10 |
+
kind: 'const',
|
| 11 |
+
declarations: [
|
| 12 |
+
{
|
| 13 |
+
type: 'VariableDeclarator',
|
| 14 |
+
id: specifier.local,
|
| 15 |
+
init: createASTArrayExpression(storyIdentifiers.map(({ exportName }) => ({
|
| 16 |
+
type: 'Literal',
|
| 17 |
+
value: exportName,
|
| 18 |
+
}))),
|
| 19 |
+
},
|
| 20 |
+
],
|
| 21 |
+
},
|
| 22 |
+
};
|
| 23 |
+
}
|
llama.cpp/build/tools/ui/ui-src/node_modules/@storybook/addon-svelte-csf/dist/compiler/post-transform/appendix/create-import.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import type { ESTreeAST } from '../../../parser/ast.js';
|
| 2 |
+
/**
|
| 3 |
+
* The export is defined in the `package.json` export map
|
| 4 |
+
*/
|
| 5 |
+
export declare function createRuntimeStoriesImport(): ESTreeAST.ImportDeclaration;
|