kaabalah 6.11.0 → 6.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2945,7 +2945,42 @@ var DEFAULT_PATH_HIGHLIGHT_WIDTH = 8;
2945
2945
  var DEFAULT_SPHERE_HIT_RADIUS = DEFAULT_SPHERE_RADIUS + 8;
2946
2946
  var DEFAULT_PATH_HIT_STROKE_WIDTH = DEFAULT_PATH_EDGE_WIDTH + 8;
2947
2947
  var MUTED_TARGET_COLOR = "#AAA";
2948
+ var INNER_BORDER_SPHERE_NAMES = /* @__PURE__ */ new Set(["Tiphareth"]);
2949
+ var NAZAR_NACRE = "__nacre__";
2950
+ var NAZAR_IRIS = "#33a6dd";
2951
+ var NAZAR_PUPIL = "#0b0b12";
2948
2952
  var sphereId = (name) => chunkQ7YAKPBH_js.id("sphere" /* SPHERE */, name);
2953
+ var pathId = (value) => chunkQ7YAKPBH_js.id("path" /* PATH */, value);
2954
+ var SPLIT_GRADIENT_PATH_IDS = new Set(
2955
+ Array.from({ length: 22 }, (_, index) => pathId(String(index + 1)))
2956
+ );
2957
+ var SPLIT_GRADIENT_BLEND = 34;
2958
+ var SPECIAL_SPHERE_PATH_COLORS = {
2959
+ Kether: "#cfe0f2",
2960
+ Chokhmah: "#e6d6ef",
2961
+ Malkuth: "#8a6a52"
2962
+ };
2963
+ var CHOKHMAH_SWEEP_SPAN = 0.42;
2964
+ var CHOKHMAH_SWEEP_SAMPLES = 12;
2965
+ function iridescentColorAt(t) {
2966
+ const frac = (t % 1 + 1) % 1;
2967
+ return interpolateColorStops(IRIDESCENT_STOPS, frac);
2968
+ }
2969
+ function iridescentContactT(center, toward) {
2970
+ const degrees = Math.atan2(toward.y - center.y, toward.x - center.x) * 180 / Math.PI;
2971
+ return ((degrees + 90) / 360 % 1 + 1) % 1;
2972
+ }
2973
+ function edgeAnchoredVector(from, to, radius) {
2974
+ const length = Math.hypot(to.x - from.x, to.y - from.y) || 1;
2975
+ const ux = (to.x - from.x) / length;
2976
+ const uy = (to.y - from.y) / length;
2977
+ return {
2978
+ x1: round3(from.x + ux * radius),
2979
+ y1: round3(from.y + uy * radius),
2980
+ x2: round3(to.x - ux * radius),
2981
+ y2: round3(to.y - uy * radius)
2982
+ };
2983
+ }
2949
2984
  var TREE_SPHERE_IDS = [...chunk47BAJUYW_js.TREE_TOPOLOGY_SPHERE_IDS];
2950
2985
  var TREE_PATH_IDS = [...chunk47BAJUYW_js.TREE_TOPOLOGY_PATH_IDS];
2951
2986
  var CANONICAL_SPHERE_PERCENTAGES = {
@@ -3197,21 +3232,44 @@ function generateTreeSvg(options = {}) {
3197
3232
  `<clipPath id="clip-${slug}"><circle cx="${point.x}" cy="${point.y}" r="${radius}"/></clipPath>`
3198
3233
  );
3199
3234
  }
3200
- push(`<radialGradient id="kether-glow" cx="50%" cy="50%" r="50%">
3201
- <stop offset="0%" stop-color="white" stop-opacity="0.95"/>
3202
- <stop offset="45%" stop-color="white" stop-opacity="0.6"/>
3203
- <stop offset="80%" stop-color="white" stop-opacity="0.15"/>
3204
- <stop offset="100%" stop-color="white" stop-opacity="0"/>
3205
- </radialGradient>`);
3206
- push(`<linearGradient id="kether-facet" x1="0" y1="0" x2="0" y2="1">
3207
- <stop offset="0%" stop-color="white" stop-opacity="0.9"/>
3208
- <stop offset="50%" stop-color="white" stop-opacity="0.5"/>
3209
- <stop offset="100%" stop-color="white" stop-opacity="0.1"/>
3210
- </linearGradient>`);
3211
- push(`<radialGradient id="kether-rim" cx="50%" cy="50%" r="75%">
3212
- <stop offset="60%" stop-color="black" stop-opacity="0"/>
3213
- <stop offset="100%" stop-color="black" stop-opacity="0.18"/>
3214
- </radialGradient>`);
3235
+ if (palette.mode === "color") {
3236
+ for (const splitPathId of SPLIT_GRADIENT_PATH_IDS) {
3237
+ const splitPath = layout.paths[splitPathId];
3238
+ if (!splitPath || highlights.pathColors[splitPathId] !== void 0 || activationMap.get(splitPathId) !== void 0) {
3239
+ continue;
3240
+ }
3241
+ const fromColor = resolveSplitEndpointColor({
3242
+ palette,
3243
+ sphereId: splitPath.fromId,
3244
+ tree
3245
+ });
3246
+ const toColor = resolveSplitEndpointColor({
3247
+ palette,
3248
+ sphereId: splitPath.toId,
3249
+ tree
3250
+ });
3251
+ const blendStart = round3(50 - SPLIT_GRADIENT_BLEND / 2);
3252
+ const blendEnd = round3(50 + SPLIT_GRADIENT_BLEND / 2);
3253
+ const fromName = chunkQ7YAKPBH_js.parseId(splitPath.fromId);
3254
+ const toName = chunkQ7YAKPBH_js.parseId(splitPath.toId);
3255
+ const contactT = toName === "Chokhmah" ? iridescentContactT(splitPath.to, splitPath.from) : fromName === "Chokhmah" ? iridescentContactT(splitPath.from, splitPath.to) : null;
3256
+ const stops = buildSplitGradientStops({
3257
+ fromName,
3258
+ toName,
3259
+ fromColor,
3260
+ toColor,
3261
+ blendStart,
3262
+ blendEnd,
3263
+ contactT
3264
+ });
3265
+ const edge = edgeAnchoredVector(splitPath.from, splitPath.to, radius);
3266
+ push(
3267
+ `<linearGradient id="path-grad-${chunkQ7YAKPBH_js.parseId(splitPathId)}" gradientUnits="userSpaceOnUse" x1="${edge.x1}" y1="${edge.y1}" x2="${edge.x2}" y2="${edge.y2}">
3268
+ ${stops}
3269
+ </linearGradient>`
3270
+ );
3271
+ }
3272
+ }
3215
3273
  push(`</defs>`);
3216
3274
  const background = options.background ?? "white";
3217
3275
  if (background !== "transparent") {
@@ -3257,22 +3315,31 @@ function generateTreeSvg(options = {}) {
3257
3315
  activation: activationMap.get(currentPathId),
3258
3316
  canonicalColor
3259
3317
  });
3260
- const color = activation ? resolvePathDisplayColor({
3261
- canonicalColor,
3262
- activation
3263
- }) : baseColor;
3264
- const edgeColor = resolvePathEdgeColor({
3265
- palette,
3266
- pathColor: color
3267
- });
3318
+ const useSplitGradient = palette.mode === "color" && !activation && highlights.pathColors[currentPathId] === void 0 && SPLIT_GRADIENT_PATH_IDS.has(currentPathId);
3319
+ const solidColor = activation ? resolvePathDisplayColor({ canonicalColor, activation }) : baseColor;
3320
+ const solidEdgeColor = resolvePathEdgeColor({ palette, pathColor: solidColor });
3321
+ const gradientRef = useSplitGradient ? `url(#path-grad-${chunkQ7YAKPBH_js.parseId(currentPathId)})` : null;
3322
+ const color = gradientRef ?? solidColor;
3323
+ const edgeColor = gradientRef ?? solidEdgeColor;
3324
+ const edgeFilter = palette.pathEdgeUseFilter ? ` filter="url(#pathDarken)"` : "";
3325
+ if (gradientRef) {
3326
+ push(
3327
+ `<line x1="${path.from.x}" y1="${path.from.y}" x2="${path.to.x}" y2="${path.to.y}" stroke="${escapeAttr3(solidEdgeColor)}" stroke-width="${pathEdgeWidth}" stroke-linecap="round"${edgeFilter}/>`
3328
+ );
3329
+ }
3268
3330
  push(
3269
- `<line x1="${path.from.x}" y1="${path.from.y}" x2="${path.to.x}" y2="${path.to.y}" stroke="${escapeAttr3(edgeColor)}" stroke-width="${pathEdgeWidth}" stroke-linecap="round"${palette.pathEdgeUseFilter ? ` filter="url(#pathDarken)"` : ""}/>`
3331
+ `<line x1="${path.from.x}" y1="${path.from.y}" x2="${path.to.x}" y2="${path.to.y}" stroke="${escapeAttr3(edgeColor)}" stroke-width="${pathEdgeWidth}" stroke-linecap="round"${edgeFilter}/>`
3270
3332
  );
3271
3333
  if (activation?.visible && activation.emphasis > 0) {
3272
3334
  push(
3273
3335
  `<line x1="${path.from.x}" y1="${path.from.y}" x2="${path.to.x}" y2="${path.to.y}" stroke="${escapeAttr3(color)}" stroke-opacity="${round3(0.18 + activation.emphasis * 0.28)}" stroke-width="${round3(pathEdgeWidth + activation.emphasis * 10)}" stroke-linecap="round"/>`
3274
3336
  );
3275
3337
  }
3338
+ if (gradientRef) {
3339
+ push(
3340
+ `<line x1="${path.from.x}" y1="${path.from.y}" x2="${path.to.x}" y2="${path.to.y}" stroke="${escapeAttr3(solidColor)}" stroke-width="${pathMainWidth}" stroke-linecap="round"/>`
3341
+ );
3342
+ }
3276
3343
  push(
3277
3344
  `<line x1="${path.from.x}" y1="${path.from.y}" x2="${path.to.x}" y2="${path.to.y}" stroke="${escapeAttr3(color)}" stroke-width="${pathMainWidth}" stroke-linecap="round"/>`
3278
3345
  );
@@ -3387,6 +3454,16 @@ function renderSphere(push, params) {
3387
3454
  push(
3388
3455
  `<circle cx="${point.x}" cy="${point.y}" r="${params.radius}" fill="none" stroke="${escapeAttr3(params.palette.sphereStrokeColor)}" stroke-width="${params.sphereStrokeWidth}"/>`
3389
3456
  );
3457
+ } else if (INNER_BORDER_SPHERE_NAMES.has(params.sphereName)) {
3458
+ const borderWidth = round3(params.radius * 0.05);
3459
+ const borderColor = interpolateColor(
3460
+ toPrimaryFill(activeFill, params.palette.defaultSphereFill),
3461
+ "#000000",
3462
+ 0.2
3463
+ );
3464
+ push(
3465
+ `<circle cx="${point.x}" cy="${point.y}" r="${round3(params.radius - borderWidth / 2)}" fill="none" stroke="${escapeAttr3(borderColor)}" stroke-width="${borderWidth}"/>`
3466
+ );
3390
3467
  }
3391
3468
  }
3392
3469
  function buildLayoutMap(tree, spherePositions) {
@@ -3473,6 +3550,40 @@ function resolveTargetActivation(params) {
3473
3550
  emphasis: state === "selected" ? clamp01(Math.max(strength, 0.9)) : state === "hovered" ? clamp01(Math.max(strength, 0.72)) : state === "active" ? clamp01(Math.max(strength, 0.56)) : 0
3474
3551
  };
3475
3552
  }
3553
+ function resolveSplitEndpointColor(params) {
3554
+ const name = chunkQ7YAKPBH_js.parseId(params.sphereId);
3555
+ return SPECIAL_SPHERE_PATH_COLORS[name] ?? resolveSphereCanonicalColor(params);
3556
+ }
3557
+ function buildSplitGradientStops(params) {
3558
+ const { fromName, toName, fromColor, toColor, blendStart, blendEnd, contactT } = params;
3559
+ const stop = (offset, color) => ` <stop offset="${round3(offset)}%" stop-color="${escapeAttr3(color)}"/>`;
3560
+ const sweep = (start, end, t0, sphereAtEnd) => Array.from({ length: CHOKHMAH_SWEEP_SAMPLES }, (_, index) => {
3561
+ const f = index / (CHOKHMAH_SWEEP_SAMPLES - 1);
3562
+ const offset = start + f * (end - start);
3563
+ const along = sphereAtEnd ? 1 - f : f;
3564
+ return stop(offset, iridescentColorAt(t0 + along * CHOKHMAH_SWEEP_SPAN));
3565
+ });
3566
+ if (toName === "Chokhmah" && contactT !== null) {
3567
+ return [
3568
+ stop(0, fromColor),
3569
+ stop(blendStart, fromColor),
3570
+ ...sweep(blendEnd, 100, contactT, true)
3571
+ ].join("\n");
3572
+ }
3573
+ if (fromName === "Chokhmah" && contactT !== null) {
3574
+ return [
3575
+ ...sweep(0, blendStart, contactT, false),
3576
+ stop(blendEnd, toColor),
3577
+ stop(100, toColor)
3578
+ ].join("\n");
3579
+ }
3580
+ return [
3581
+ stop(0, fromColor),
3582
+ stop(blendStart, fromColor),
3583
+ stop(blendEnd, toColor),
3584
+ stop(100, toColor)
3585
+ ].join("\n");
3586
+ }
3476
3587
  function resolveSphereCanonicalColor(params) {
3477
3588
  const override = params.palette.sphereFills[params.sphereId];
3478
3589
  if (override) {
@@ -3720,33 +3831,18 @@ function arcPath2(cx, cy, radius, startDegrees, endDegrees) {
3720
3831
  const largeArc = endDegrees - startDegrees <= 180 ? 0 : 1;
3721
3832
  return `M ${cx} ${cy} L ${start.x} ${start.y} A ${radius} ${radius} 0 ${largeArc} 1 ${end.x} ${end.y} Z`;
3722
3833
  }
3723
- function renderKether(push, point, radius, baseFill = "#e0e0e0") {
3834
+ function renderKether(push, point, radius, baseFill = NAZAR_NACRE) {
3835
+ const { x, y } = point;
3836
+ renderIridescent(push, point, radius, NACRE_STOPS);
3837
+ if (baseFill !== NAZAR_NACRE) {
3838
+ renderSphereTintOverlay(push, point, radius, baseFill, 0.5);
3839
+ }
3724
3840
  push(
3725
- `<circle cx="${point.x}" cy="${point.y}" r="${radius}" fill="${escapeAttr3(baseFill)}"/>`
3841
+ `<circle cx="${x}" cy="${y}" r="${round3(radius * 0.42)}" fill="${escapeAttr3(NAZAR_IRIS)}"/>`
3842
+ );
3843
+ push(
3844
+ `<circle cx="${x}" cy="${y}" r="${round3(radius * 0.2)}" fill="${escapeAttr3(NAZAR_PUPIL)}"/>`
3726
3845
  );
3727
- push(`<circle cx="${point.x}" cy="${point.y}" r="${radius}" fill="url(#kether-glow)"/>`);
3728
- const spokes = 16;
3729
- const innerRadius = round3(radius * 0.18);
3730
- const outerRadius = round3(radius * 0.92);
3731
- const innerWidth = round3(radius * 0.04);
3732
- const angleStep = 360 / spokes;
3733
- push(`<g opacity="0.85">`);
3734
- for (let index = 0; index < spokes; index++) {
3735
- const angle = index * angleStep;
3736
- push(`<g transform="rotate(${angle} ${point.x} ${point.y})">`);
3737
- const x0 = round3(point.x - innerWidth);
3738
- const y0 = round3(point.y - innerRadius);
3739
- const x1 = point.x;
3740
- const y1 = round3(point.y - outerRadius);
3741
- const x2 = round3(point.x + innerWidth);
3742
- const y2 = round3(point.y - innerRadius);
3743
- push(
3744
- `<polygon points="${x0},${y0} ${x1},${y1} ${x2},${y2} ${point.x},${point.y}" fill="url(#kether-facet)"/>`
3745
- );
3746
- push(`</g>`);
3747
- }
3748
- push(`</g>`);
3749
- push(`<circle cx="${point.x}" cy="${point.y}" r="${radius}" fill="url(#kether-rim)"/>`);
3750
3846
  }
3751
3847
  function renderSlicedSphere(push, point, radius, colors, startAngle) {
3752
3848
  const segmentCount = colors.length;
@@ -3758,18 +3854,28 @@ function renderSlicedSphere(push, point, radius, colors, startAngle) {
3758
3854
  currentAngle += step;
3759
3855
  }
3760
3856
  }
3761
- function renderIridescent(push, point, radius) {
3762
- const stops = [
3763
- [0, "#F0E8EE"],
3764
- [0.1, "#ffa3e6"],
3765
- [0.22, "#a7e0ff"],
3766
- [0.34, "#baff9a"],
3767
- [0.46, "#ffe28a"],
3768
- [0.58, "#c6a4ff"],
3769
- [0.7, "#9ad6ff"],
3770
- [0.82, "#ffa3e6"],
3771
- [1, "#F0E8EE"]
3772
- ];
3857
+ var IRIDESCENT_STOPS = [
3858
+ [0, "#F0E8EE"],
3859
+ [0.1, "#ffa3e6"],
3860
+ [0.22, "#a7e0ff"],
3861
+ [0.34, "#baff9a"],
3862
+ [0.46, "#ffe28a"],
3863
+ [0.58, "#c6a4ff"],
3864
+ [0.7, "#9ad6ff"],
3865
+ [0.82, "#ffa3e6"],
3866
+ [1, "#F0E8EE"]
3867
+ ];
3868
+ var NACRE_STOPS = [
3869
+ [0, "#eaf6f6"],
3870
+ [0.12, "#a8d6ec"],
3871
+ [0.25, "#c3b6ec"],
3872
+ [0.4, "#a6ecec"],
3873
+ [0.55, "#dfe6fb"],
3874
+ [0.7, "#a6cdf0"],
3875
+ [0.82, "#cbb4ec"],
3876
+ [1, "#eaf6f6"]
3877
+ ];
3878
+ function renderIridescent(push, point, radius, stops = IRIDESCENT_STOPS) {
3773
3879
  const slices = 72;
3774
3880
  const sphereRadius = round3(radius * 0.96);
3775
3881
  for (let index = 0; index < slices; index++) {
@@ -3889,4 +3995,4 @@ exports.getTreeLayout = getTreeLayout;
3889
3995
  exports.getTreeRenderModel = getTreeRenderModel;
3890
3996
  exports.listAstroGlyphs = listAstroGlyphs;
3891
3997
  //# sourceMappingURL=out.js.map
3892
- //# sourceMappingURL=chunk-XUD2HQUG.js.map
3998
+ //# sourceMappingURL=chunk-LUHQNKKJ.js.map