[K4] Stiftsätze im Kern: Standardpalette, Neu-Backen der Stift-Farben, Stift löschen mit Verweisen (pens.rs)
Wurzel-Abfragen (run_root, doc_query_root, ProjectDocument.queryRoot) liefern Ops; model/penSets.ts ist Fassade, TS-Rechnung (Palette, rebakePenOps, clearCategoryPenRefs in projectSlice) gelöscht.
This commit is contained in:
14 files changed
+583
-256
No files matched your search
@@ -18,7 +18,7 @@
|
||||
// Manager läuft auch als eigenes natives Fenster ohne gemeinsamen Store.
|
||||
|
||||
import { useState } from "react";
|
||||
import { FREE_COLOR_PALETTE } from "../model/penSets";
|
||||
import { freeColorPalette } from "../model/penSets";
|
||||
import { MATERIAL_PALETTE, RAL_CLASSIC, TANGO_PALETTE } from "../model/color";
|
||||
import type { BuiltinPaletteBanks, CustomPalette } from "../model/types";
|
||||
import { Swatch } from "./ColorSwatchCell";
|
||||
@@ -59,7 +59,7 @@ export function FreeColorPicker({
|
||||
banks.push({
|
||||
id: "simple",
|
||||
label: t("pen.paletteSimple"),
|
||||
entries: FREE_COLOR_PALETTE.map((hex) => ({ hex, title: hex })),
|
||||
entries: freeColorPalette().map((hex) => ({ hex, title: hex })),
|
||||
});
|
||||
}
|
||||
if (builtinBanks?.tango !== false) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import { useState } from "react";
|
||||
import type { BuiltinPaletteBank, Project } from "../../model/types";
|
||||
import { MATERIAL_PALETTE, RAL_CLASSIC, TANGO_PALETTE } from "../../model/color";
|
||||
import { FREE_COLOR_PALETTE } from "../../model/penSets";
|
||||
import { freeColorPalette } from "../../model/penSets";
|
||||
import { t } from "../../i18n";
|
||||
import { DeleteButton, EmptyState, FieldRow, TextField } from "./fields";
|
||||
|
||||
@@ -20,15 +20,16 @@ import { DeleteButton, EmptyState, FieldRow, TextField } from "./fields";
|
||||
* Die vier mitgelieferten Bänke. `labelKey` statt fertigem Label, damit `t()`
|
||||
* erst zur RENDERZEIT läuft (Sprachwechsel wirkt sonst nicht — gleiche
|
||||
* Konvention wie `PATTERN_OPTIONS` in `HatchesTab.tsx`); Eigennamen
|
||||
* (Tango/Material/RAL) stehen direkt in `label`.
|
||||
* (Tango/Material/RAL) stehen direkt in `label`. Eine Funktion, weil die Freie-Farbe-Palette aus dem
|
||||
* Kern kommt (erst nach `initCore()` lesbar).
|
||||
*/
|
||||
const BUILTIN_BANKS: {
|
||||
const builtinBanks = (): {
|
||||
id: BuiltinPaletteBank;
|
||||
label?: string;
|
||||
labelKey?: string;
|
||||
preview: string[];
|
||||
}[] = [
|
||||
{ id: "simple", labelKey: "pen.paletteSimple", preview: FREE_COLOR_PALETTE },
|
||||
}[] => [
|
||||
{ id: "simple", labelKey: "pen.paletteSimple", preview: freeColorPalette() },
|
||||
{ id: "tango", label: "Tango", preview: TANGO_PALETTE.map((c) => c.hex) },
|
||||
{ id: "material", label: "Material", preview: MATERIAL_PALETTE.map((c) => c.hex) },
|
||||
{ id: "ral", label: "RAL Classic", preview: RAL_CLASSIC.map((c) => c.hex) },
|
||||
@@ -73,7 +74,7 @@ export function PalettesTab({
|
||||
{/* Mitgelieferte Bänke: nur ein/aus — Inhalt ist fest. */}
|
||||
<div className="res-fields">
|
||||
<div className="res-section-label">{t("resources.palettes.builtin")}</div>
|
||||
{BUILTIN_BANKS.map((bank) => (
|
||||
{builtinBanks().map((bank) => (
|
||||
<FieldRow
|
||||
key={bank.id}
|
||||
label={bank.label ?? t(bank.labelKey!)}
|
||||
|
||||
Reference in new issue
Block a user