@likec4/diagram 1.28.1 → 1.29.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.
package/bundle/index.js CHANGED
@@ -13486,11 +13486,13 @@ const AnimatePresence = ({ children: children2, custom: custom5, initial = !0, o
13486
13486
  return jsx(PresenceChild, { isPresent, initial: !isInitialRender.current || initial ? void 0 : !1, custom: custom5, presenceAffectsLayout, mode, onExitComplete: isPresent ? void 0 : onExit, anchorX, children: child }, key2);
13487
13487
  }) });
13488
13488
  }, DeprecatedLayoutGroupContext = createContext(null);
13489
- let invariant = () => {
13490
- };
13491
- const noop$2 = /* @__NO_SIDE_EFFECTS__ */ (any) => any, MotionGlobalConfig = {
13492
- useManualTiming: !1
13493
- }, stepsOrder = [
13489
+ function useIsMounted() {
13490
+ const isMounted = useRef(!1);
13491
+ return useIsomorphicLayoutEffect$1(() => (isMounted.current = !0, () => {
13492
+ isMounted.current = !1;
13493
+ }), []), isMounted;
13494
+ }
13495
+ const stepsOrder = [
13494
13496
  "read",
13495
13497
  // Read
13496
13498
  "resolveKeyframes",
@@ -13542,7 +13544,9 @@ function createRenderStep(runNextFrame, stepName) {
13542
13544
  };
13543
13545
  return step;
13544
13546
  }
13545
- const maxElapsed = 40;
13547
+ const MotionGlobalConfig = {
13548
+ useManualTiming: !1
13549
+ }, maxElapsed = 40;
13546
13550
  function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
13547
13551
  let runNextFrame = !1, useDefaultElapsed = !0;
13548
13552
  const state = {
@@ -13563,13 +13567,7 @@ function createRenderBatcher(scheduleNextBatch, allowKeepAlive) {
13563
13567
  steps[stepsOrder[i2]].cancel(process2);
13564
13568
  }, state, steps };
13565
13569
  }
13566
- const { schedule: frame$1, cancel: cancelFrame, state: frameData, steps: frameSteps } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame < "u" ? requestAnimationFrame : noop$2, !0);
13567
- function useIsMounted() {
13568
- const isMounted = useRef(!1);
13569
- return useIsomorphicLayoutEffect$1(() => (isMounted.current = !0, () => {
13570
- isMounted.current = !1;
13571
- }), []), isMounted;
13572
- }
13570
+ const noop$2 = /* @__NO_SIDE_EFFECTS__ */ (any) => any, { schedule: frame$1, cancel: cancelFrame, state: frameData, steps: frameSteps } = /* @__PURE__ */ createRenderBatcher(typeof requestAnimationFrame < "u" ? requestAnimationFrame : noop$2, !0);
13573
13571
  function useForceUpdate() {
13574
13572
  const isMounted = useIsMounted(), [forcedRenderCount, setForcedRenderCount] = useState(0), forceRender = useCallback(() => {
13575
13573
  isMounted.current && setForcedRenderCount(forcedRenderCount + 1);
@@ -13773,7 +13771,7 @@ function useMotionRef(visualState, visualElement, externalRef) {
13773
13771
  [visualElement]
13774
13772
  );
13775
13773
  }
13776
- const { schedule: microtask } = /* @__PURE__ */ createRenderBatcher(queueMicrotask, !1), camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), optimizedAppearDataId = "framerAppearId", optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId), SwitchLayoutGroupContext = createContext({});
13774
+ const camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), optimizedAppearDataId = "framerAppearId", optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId), SwitchLayoutGroupContext = createContext({}), { schedule: microtask } = /* @__PURE__ */ createRenderBatcher(queueMicrotask, !1);
13777
13775
  function useVisualElement(Component2, visualState, props, createVisualElement, ProjectionNodeConstructor) {
13778
13776
  const { visualElement: parent } = useContext(MotionContext), lazyContext = useContext(LazyContext), presenceContext = useContext(PresenceContext), reducedMotionConfig = useContext(MotionConfigContext).reducedMotion, visualElementRef = useRef(null);
13779
13777
  createVisualElement = createVisualElement || lazyContext.renderer, !visualElementRef.current && createVisualElement && (visualElementRef.current = createVisualElement(Component2, {
@@ -13800,7 +13798,7 @@ function useVisualElement(Component2, visualState, props, createVisualElement, P
13800
13798
  }), visualElement;
13801
13799
  }
13802
13800
  function createProjectionNode$1(visualElement, props, ProjectionNodeConstructor, initialPromotionConfig) {
13803
- const { layoutId, layout: layout2, drag: drag2, dragConstraints, layoutScroll, layoutRoot } = props;
13801
+ const { layoutId, layout: layout2, drag: drag2, dragConstraints, layoutScroll, layoutRoot, layoutCrossfade } = props;
13804
13802
  visualElement.projection = new ProjectionNodeConstructor(visualElement.latestValues, props["data-framer-portal-id"] ? void 0 : getClosestProjectingNode(visualElement.parent)), visualElement.projection.setOptions({
13805
13803
  layoutId,
13806
13804
  layout: layout2,
@@ -13815,6 +13813,7 @@ function createProjectionNode$1(visualElement, props, ProjectionNodeConstructor,
13815
13813
  */
13816
13814
  animationType: typeof layout2 == "string" ? layout2 : "both",
13817
13815
  initialPromotionConfig,
13816
+ crossfade: layoutCrossfade,
13818
13817
  layoutScroll,
13819
13818
  layoutRoot
13820
13819
  });
@@ -13823,6 +13822,8 @@ function getClosestProjectingNode(visualElement) {
13823
13822
  if (visualElement)
13824
13823
  return visualElement.options.allowProjection !== !1 ? visualElement.projection : getClosestProjectingNode(visualElement.parent);
13825
13824
  }
13825
+ let invariant = () => {
13826
+ };
13826
13827
  function createRendererMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component: Component2 }) {
13827
13828
  function MotionComponent(props, externalRef) {
13828
13829
  let MeasureLayout2;
@@ -14342,9 +14343,6 @@ function resolveVariant(visualElement, definition, custom5) {
14342
14343
  const props = visualElement.getProps();
14343
14344
  return resolveVariantFromProps(props, definition, custom5 !== void 0 ? custom5 : props.custom, visualElement);
14344
14345
  }
14345
- function getValueTransition$1(transition, key2) {
14346
- return transition?.[key2] ?? transition?.default ?? transition;
14347
- }
14348
14346
  const positionalKeys = /* @__PURE__ */ new Set([
14349
14347
  "width",
14350
14348
  "height",
@@ -14354,6 +14352,16 @@ const positionalKeys = /* @__PURE__ */ new Set([
14354
14352
  "bottom",
14355
14353
  ...transformPropOrder
14356
14354
  ]);
14355
+ let now$1;
14356
+ function clearTime() {
14357
+ now$1 = void 0;
14358
+ }
14359
+ const time = {
14360
+ now: () => (now$1 === void 0 && time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming ? frameData.timestamp : performance.now()), now$1),
14361
+ set: (newTime) => {
14362
+ now$1 = newTime, queueMicrotask(clearTime);
14363
+ }
14364
+ };
14357
14365
  function addUniqueItem(arr, item) {
14358
14366
  arr.indexOf(item) === -1 && arr.push(item);
14359
14367
  }
@@ -14389,16 +14397,7 @@ class SubscriptionManager {
14389
14397
  function velocityPerSecond(velocity, frameDuration) {
14390
14398
  return frameDuration ? velocity * (1e3 / frameDuration) : 0;
14391
14399
  }
14392
- let now$1;
14393
- function clearTime() {
14394
- now$1 = void 0;
14395
- }
14396
- const time = {
14397
- now: () => (now$1 === void 0 && time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming ? frameData.timestamp : performance.now()), now$1),
14398
- set: (newTime) => {
14399
- now$1 = newTime, queueMicrotask(clearTime);
14400
- }
14401
- }, MAX_VELOCITY_DELTA = 30, isFloat = (value) => !isNaN(parseFloat(value));
14400
+ const MAX_VELOCITY_DELTA = 30, isFloat = (value) => !isNaN(parseFloat(value));
14402
14401
  class MotionValue {
14403
14402
  /**
14404
14403
  * @param init - The initiating value
@@ -14407,7 +14406,7 @@ class MotionValue {
14407
14406
  * - `transformer`: A function to transform incoming values with.
14408
14407
  */
14409
14408
  constructor(init2, options = {}) {
14410
- this.version = "12.6.3", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (v2, render = !0) => {
14409
+ this.version = "12.7.3", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (v2, render = !0) => {
14411
14410
  const currentTime = time.now();
14412
14411
  this.updatedAt !== currentTime && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(v2), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), render && this.events.renderRequest && this.events.renderRequest.notify(this.current);
14413
14412
  }, this.hasAnimated = !1, this.setCurrent(init2), this.owner = options.owner;
@@ -14609,151 +14608,14 @@ function addValueToWillChange(visualElement, key2) {
14609
14608
  const willChange = visualElement.getValue("willChange");
14610
14609
  if (isWillChangeMotionValue(willChange))
14611
14610
  return willChange.add(key2);
14611
+ if (!willChange && MotionGlobalConfig.WillChange) {
14612
+ const newWillChange = new MotionGlobalConfig.WillChange("auto");
14613
+ visualElement.addValue("willChange", newWillChange), newWillChange.add(key2);
14614
+ }
14612
14615
  }
14613
14616
  function getOptimisedAppearId(visualElement) {
14614
14617
  return visualElement.props[optimizedAppearDataAttribute];
14615
14618
  }
14616
- const secondsToMilliseconds = /* @__NO_SIDE_EFFECTS__ */ (seconds) => seconds * 1e3, millisecondsToSeconds = /* @__NO_SIDE_EFFECTS__ */ (milliseconds) => milliseconds / 1e3;
14617
- // @__NO_SIDE_EFFECTS__
14618
- function memo$1(callback) {
14619
- let result;
14620
- return () => (result === void 0 && (result = callback()), result);
14621
- }
14622
- const supportsScrollTimeline = /* @__PURE__ */ memo$1(() => window.ScrollTimeline !== void 0);
14623
- class GroupAnimation {
14624
- constructor(animations2) {
14625
- this.stop = () => this.runAll("stop"), this.animations = animations2.filter(Boolean);
14626
- }
14627
- get finished() {
14628
- return Promise.all(this.animations.map((animation) => animation.finished));
14629
- }
14630
- /**
14631
- * TODO: Filter out cancelled or stopped animations before returning
14632
- */
14633
- getAll(propName) {
14634
- return this.animations[0][propName];
14635
- }
14636
- setAll(propName, newValue) {
14637
- for (let i2 = 0; i2 < this.animations.length; i2++)
14638
- this.animations[i2][propName] = newValue;
14639
- }
14640
- attachTimeline(timeline, fallback) {
14641
- const subscriptions = this.animations.map((animation) => {
14642
- if (supportsScrollTimeline() && animation.attachTimeline)
14643
- return animation.attachTimeline(timeline);
14644
- if (typeof fallback == "function")
14645
- return fallback(animation);
14646
- });
14647
- return () => {
14648
- subscriptions.forEach((cancel2, i2) => {
14649
- cancel2 && cancel2(), this.animations[i2].stop();
14650
- });
14651
- };
14652
- }
14653
- get time() {
14654
- return this.getAll("time");
14655
- }
14656
- set time(time2) {
14657
- this.setAll("time", time2);
14658
- }
14659
- get speed() {
14660
- return this.getAll("speed");
14661
- }
14662
- set speed(speed) {
14663
- this.setAll("speed", speed);
14664
- }
14665
- get startTime() {
14666
- return this.getAll("startTime");
14667
- }
14668
- get duration() {
14669
- let max2 = 0;
14670
- for (let i2 = 0; i2 < this.animations.length; i2++)
14671
- max2 = Math.max(max2, this.animations[i2].duration);
14672
- return max2;
14673
- }
14674
- runAll(methodName) {
14675
- this.animations.forEach((controls) => controls[methodName]());
14676
- }
14677
- flatten() {
14678
- this.runAll("flatten");
14679
- }
14680
- play() {
14681
- this.runAll("play");
14682
- }
14683
- pause() {
14684
- this.runAll("pause");
14685
- }
14686
- cancel() {
14687
- this.runAll("cancel");
14688
- }
14689
- complete() {
14690
- this.runAll("complete");
14691
- }
14692
- }
14693
- class GroupAnimationWithThen extends GroupAnimation {
14694
- then(onResolve, _onReject) {
14695
- return this.finished.finally(onResolve).then(() => {
14696
- });
14697
- }
14698
- }
14699
- const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] == "number", supportsFlags = {};
14700
- function memoSupports(callback, supportsFlag) {
14701
- const memoized = /* @__PURE__ */ memo$1(callback);
14702
- return () => supportsFlags[supportsFlag] ?? memoized();
14703
- }
14704
- const supportsLinearEasing = /* @__PURE__ */ memoSupports(() => {
14705
- try {
14706
- document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
14707
- } catch {
14708
- return !1;
14709
- }
14710
- return !0;
14711
- }, "linearEasing"), generateLinearEasing = (easing, duration, resolution = 10) => {
14712
- let points = "";
14713
- const numPoints = Math.max(Math.round(duration / resolution), 2);
14714
- for (let i2 = 0; i2 < numPoints; i2++)
14715
- points += easing(i2 / (numPoints - 1)) + ", ";
14716
- return `linear(${points.substring(0, points.length - 2)})`;
14717
- }, cubicBezierAsString = ([a2, b2, c2, d2]) => `cubic-bezier(${a2}, ${b2}, ${c2}, ${d2})`, supportedWaapiEasing = {
14718
- linear: "linear",
14719
- ease: "ease",
14720
- easeIn: "ease-in",
14721
- easeOut: "ease-out",
14722
- easeInOut: "ease-in-out",
14723
- circIn: /* @__PURE__ */ cubicBezierAsString([0, 0.65, 0.55, 1]),
14724
- circOut: /* @__PURE__ */ cubicBezierAsString([0.55, 0, 1, 0.45]),
14725
- backIn: /* @__PURE__ */ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),
14726
- backOut: /* @__PURE__ */ cubicBezierAsString([0.33, 1.53, 0.69, 0.99])
14727
- };
14728
- function mapEasingToNativeEasing(easing, duration) {
14729
- if (easing)
14730
- return typeof easing == "function" && supportsLinearEasing() ? generateLinearEasing(easing, duration) : isBezierDefinition(easing) ? cubicBezierAsString(easing) : Array.isArray(easing) ? easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || supportedWaapiEasing.easeOut) : supportedWaapiEasing[easing];
14731
- }
14732
- function startWaapiAnimation(element, valueName, keyframes2, { delay: delay2 = 0, duration = 300, repeat = 0, repeatType = "loop", ease: ease2 = "easeInOut", times } = {}, pseudoElement = void 0) {
14733
- const keyframeOptions = {
14734
- [valueName]: keyframes2
14735
- };
14736
- times && (keyframeOptions.offset = times);
14737
- const easing = mapEasingToNativeEasing(ease2, duration);
14738
- return Array.isArray(easing) && (keyframeOptions.easing = easing), element.animate(keyframeOptions, {
14739
- delay: delay2,
14740
- duration,
14741
- easing: Array.isArray(easing) ? "linear" : easing,
14742
- fill: "both",
14743
- iterations: repeat + 1,
14744
- direction: repeatType === "reverse" ? "alternate" : "normal",
14745
- pseudoElement
14746
- });
14747
- }
14748
- function isGenerator(type) {
14749
- return typeof type == "function" && "applyToOptions" in type;
14750
- }
14751
- function isWaapiSupportedEasing(easing) {
14752
- return !!(typeof easing == "function" && supportsLinearEasing() || !easing || typeof easing == "string" && (easing in supportedWaapiEasing || supportsLinearEasing()) || isBezierDefinition(easing) || Array.isArray(easing) && easing.every(isWaapiSupportedEasing));
14753
- }
14754
- function attachTimeline(animation, timeline) {
14755
- animation.timeline = timeline, animation.onfinish = null;
14756
- }
14757
14619
  const calcBezier = (t2, a1, a2) => (((1 - 3 * a2 + 3 * a1) * t2 + (3 * a2 - 6 * a1)) * t2 + 3 * a1) * t2, subdivisionPrecision = 1e-7, subdivisionMaxIterations = 12;
14758
14620
  function binarySubdivide(x2, lowerBound, upperBound, mX1, mX2) {
14759
14621
  let currentX, currentT, i2 = 0;
@@ -15139,6 +15001,9 @@ class DOMKeyframesResolver extends KeyframeResolver {
15139
15001
  const isAnimatable = (value, name) => name === "zIndex" ? !1 : !!(typeof value == "number" || Array.isArray(value) || typeof value == "string" && // It's animatable if we have a string
15140
15002
  (complex.test(value) || value === "0") && // And it contains numbers and/or colors
15141
15003
  !value.startsWith("url("));
15004
+ function isGenerator(type) {
15005
+ return typeof type == "function" && "applyToOptions" in type;
15006
+ }
15142
15007
  function hasKeyframesChanged(keyframes2) {
15143
15008
  const current = keyframes2[0];
15144
15009
  if (keyframes2.length === 1)
@@ -15236,15 +15101,6 @@ class BaseAnimation {
15236
15101
  });
15237
15102
  }
15238
15103
  }
15239
- const maxGeneratorDuration = 2e4;
15240
- function calcGeneratorDuration(generator) {
15241
- let duration = 0;
15242
- const timeStep = 50;
15243
- let state = generator.next(duration);
15244
- for (; !state.done && duration < maxGeneratorDuration; )
15245
- duration += timeStep, state = generator.next(duration);
15246
- return duration >= maxGeneratorDuration ? 1 / 0 : duration;
15247
- }
15248
15104
  const mixNumber$1 = (from, to, progress2) => from + (to - from) * progress2;
15249
15105
  function hueToRgb(p2, q, t2) {
15250
15106
  return t2 < 0 && (t2 += 1), t2 > 1 && (t2 -= 1), t2 < 1 / 6 ? p2 + (q - p2) * 6 * t2 : t2 < 1 / 2 ? q : t2 < 2 / 3 ? p2 + (q - p2) * (2 / 3 - t2) * 6 : p2;
@@ -15328,14 +15184,6 @@ const mixComplex = (origin, target) => {
15328
15184
  function mix(from, to, p2) {
15329
15185
  return typeof from == "number" && typeof to == "number" && typeof p2 == "number" ? mixNumber$1(from, to, p2) : getMixer(from)(from, to);
15330
15186
  }
15331
- function createGeneratorEasing(options, scale2 = 100, createGenerator) {
15332
- const generator = createGenerator({ ...options, keyframes: [0, scale2] }), duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
15333
- return {
15334
- type: "keyframes",
15335
- ease: (progress2) => generator.next(duration * progress2).value / scale2,
15336
- duration: /* @__PURE__ */ millisecondsToSeconds(duration)
15337
- };
15338
- }
15339
15187
  const velocitySampleDuration = 5;
15340
15188
  function calcGeneratorVelocity(resolveValue, t2, current) {
15341
15189
  const prevT = Math.max(t2 - velocitySampleDuration, 0);
@@ -15369,7 +15217,7 @@ const springDefaults = {
15369
15217
  // in seconds
15370
15218
  minDamping: 0.05,
15371
15219
  maxDamping: 1
15372
- }, safeMin = 1e-3;
15220
+ }, secondsToMilliseconds = /* @__NO_SIDE_EFFECTS__ */ (seconds) => seconds * 1e3, millisecondsToSeconds = /* @__NO_SIDE_EFFECTS__ */ (milliseconds) => milliseconds / 1e3, safeMin = 1e-3;
15373
15221
  function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass }) {
15374
15222
  let envelope, derivative, dampingRatio = 1 - bounce;
15375
15223
  dampingRatio = clamp$1(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio), duration = clamp$1(springDefaults.minDuration, springDefaults.maxDuration, /* @__PURE__ */ millisecondsToSeconds(duration)), dampingRatio < 1 ? (envelope = (undampedFreq2) => {
@@ -15411,7 +15259,47 @@ function approximateRoot(envelope, derivative, initialGuess) {
15411
15259
  function calcAngularFreq(undampedFreq, dampingRatio) {
15412
15260
  return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);
15413
15261
  }
15414
- const durationKeys = ["duration", "bounce"], physicsKeys = ["stiffness", "damping", "mass"];
15262
+ const maxGeneratorDuration = 2e4;
15263
+ function calcGeneratorDuration(generator) {
15264
+ let duration = 0;
15265
+ const timeStep = 50;
15266
+ let state = generator.next(duration);
15267
+ for (; !state.done && duration < maxGeneratorDuration; )
15268
+ duration += timeStep, state = generator.next(duration);
15269
+ return duration >= maxGeneratorDuration ? 1 / 0 : duration;
15270
+ }
15271
+ function createGeneratorEasing(options, scale2 = 100, createGenerator) {
15272
+ const generator = createGenerator({ ...options, keyframes: [0, scale2] }), duration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
15273
+ return {
15274
+ type: "keyframes",
15275
+ ease: (progress2) => generator.next(duration * progress2).value / scale2,
15276
+ duration: /* @__PURE__ */ millisecondsToSeconds(duration)
15277
+ };
15278
+ }
15279
+ const supportsFlags = {};
15280
+ // @__NO_SIDE_EFFECTS__
15281
+ function memo$1(callback) {
15282
+ let result;
15283
+ return () => (result === void 0 && (result = callback()), result);
15284
+ }
15285
+ function memoSupports(callback, supportsFlag) {
15286
+ const memoized = /* @__PURE__ */ memo$1(callback);
15287
+ return () => supportsFlags[supportsFlag] ?? memoized();
15288
+ }
15289
+ const supportsLinearEasing = /* @__PURE__ */ memoSupports(() => {
15290
+ try {
15291
+ document.createElement("div").animate({ opacity: 0 }, { easing: "linear(0, 1)" });
15292
+ } catch {
15293
+ return !1;
15294
+ }
15295
+ return !0;
15296
+ }, "linearEasing"), generateLinearEasing = (easing, duration, resolution = 10) => {
15297
+ let points = "";
15298
+ const numPoints = Math.max(Math.round(duration / resolution), 2);
15299
+ for (let i2 = 0; i2 < numPoints; i2++)
15300
+ points += easing(i2 / (numPoints - 1)) + ", ";
15301
+ return `linear(${points.substring(0, points.length - 2)})`;
15302
+ }, durationKeys = ["duration", "bounce"], physicsKeys = ["stiffness", "damping", "mass"];
15415
15303
  function isSpringType(options, keys2) {
15416
15304
  return keys2.some((key2) => options[key2] !== void 0);
15417
15305
  }
@@ -15530,7 +15418,7 @@ function inertia({ keyframes: keyframes2, velocity = 0, power = 0.8, timeConstan
15530
15418
  }
15531
15419
  };
15532
15420
  }
15533
- const easeIn = /* @__PURE__ */ cubicBezier(0.42, 0, 1, 1), easeOut = /* @__PURE__ */ cubicBezier(0, 0, 0.58, 1), easeInOut = /* @__PURE__ */ cubicBezier(0.42, 0, 0.58, 1), isEasingArray = (ease2) => Array.isArray(ease2) && typeof ease2[0] != "number", easingLookup = {
15421
+ const easeIn = /* @__PURE__ */ cubicBezier(0.42, 0, 1, 1), easeOut = /* @__PURE__ */ cubicBezier(0, 0, 0.58, 1), easeInOut = /* @__PURE__ */ cubicBezier(0.42, 0, 0.58, 1), isEasingArray = (ease2) => Array.isArray(ease2) && typeof ease2[0] != "number", isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0] == "number", easingLookup = {
15534
15422
  linear: noop$2,
15535
15423
  easeIn,
15536
15424
  easeInOut,
@@ -15771,7 +15659,44 @@ const acceleratedValues = /* @__PURE__ */ new Set([
15771
15659
  // TODO: Can be accelerated but currently disabled until https://issues.chromium.org/issues/41491098 is resolved
15772
15660
  // or until we implement support for linear() easing.
15773
15661
  // "background-color"
15774
- ]), supportsWaapi = /* @__PURE__ */ memo$1(() => Object.hasOwnProperty.call(Element.prototype, "animate")), sampleDelta = 10, maxDuration = 2e4;
15662
+ ]), supportsWaapi = /* @__PURE__ */ memo$1(() => Object.hasOwnProperty.call(Element.prototype, "animate")), cubicBezierAsString = ([a2, b2, c2, d2]) => `cubic-bezier(${a2}, ${b2}, ${c2}, ${d2})`, supportedWaapiEasing = {
15663
+ linear: "linear",
15664
+ ease: "ease",
15665
+ easeIn: "ease-in",
15666
+ easeOut: "ease-out",
15667
+ easeInOut: "ease-in-out",
15668
+ circIn: /* @__PURE__ */ cubicBezierAsString([0, 0.65, 0.55, 1]),
15669
+ circOut: /* @__PURE__ */ cubicBezierAsString([0.55, 0, 1, 0.45]),
15670
+ backIn: /* @__PURE__ */ cubicBezierAsString([0.31, 0.01, 0.66, -0.59]),
15671
+ backOut: /* @__PURE__ */ cubicBezierAsString([0.33, 1.53, 0.69, 0.99])
15672
+ };
15673
+ function mapEasingToNativeEasing(easing, duration) {
15674
+ if (easing)
15675
+ return typeof easing == "function" && supportsLinearEasing() ? generateLinearEasing(easing, duration) : isBezierDefinition(easing) ? cubicBezierAsString(easing) : Array.isArray(easing) ? easing.map((segmentEasing) => mapEasingToNativeEasing(segmentEasing, duration) || supportedWaapiEasing.easeOut) : supportedWaapiEasing[easing];
15676
+ }
15677
+ function startWaapiAnimation(element, valueName, keyframes2, { delay: delay2 = 0, duration = 300, repeat = 0, repeatType = "loop", ease: ease2 = "easeInOut", times } = {}, pseudoElement = void 0) {
15678
+ const keyframeOptions = {
15679
+ [valueName]: keyframes2
15680
+ };
15681
+ times && (keyframeOptions.offset = times);
15682
+ const easing = mapEasingToNativeEasing(ease2, duration);
15683
+ return Array.isArray(easing) && (keyframeOptions.easing = easing), element.animate(keyframeOptions, {
15684
+ delay: delay2,
15685
+ duration,
15686
+ easing: Array.isArray(easing) ? "linear" : easing,
15687
+ fill: "both",
15688
+ iterations: repeat + 1,
15689
+ direction: repeatType === "reverse" ? "alternate" : "normal",
15690
+ pseudoElement
15691
+ });
15692
+ }
15693
+ function attachTimeline(animation, timeline) {
15694
+ animation.timeline = timeline, animation.onfinish = null;
15695
+ }
15696
+ function isWaapiSupportedEasing(easing) {
15697
+ return !!(typeof easing == "function" && supportsLinearEasing() || !easing || typeof easing == "string" && (easing in supportedWaapiEasing || supportsLinearEasing()) || isBezierDefinition(easing) || Array.isArray(easing) && easing.every(isWaapiSupportedEasing));
15698
+ }
15699
+ const sampleDelta = 10, maxDuration = 2e4;
15775
15700
  function requiresPregeneratedKeyframes(options) {
15776
15701
  return isGenerator(options.type) || options.type === "spring" || !isWaapiSupportedEasing(options.ease);
15777
15702
  }
@@ -15980,6 +15905,86 @@ const underDampedSpring = {
15980
15905
  function isTransitionDefined({ when, delay: _delay, delayChildren, staggerChildren, staggerDirection, repeat, repeatType, repeatDelay, from, elapsed, ...transition }) {
15981
15906
  return !!Object.keys(transition).length;
15982
15907
  }
15908
+ function getValueTransition$1(transition, key2) {
15909
+ return transition?.[key2] ?? transition?.default ?? transition;
15910
+ }
15911
+ const supportsScrollTimeline = /* @__PURE__ */ memo$1(() => window.ScrollTimeline !== void 0);
15912
+ class GroupAnimation {
15913
+ constructor(animations2) {
15914
+ this.stop = () => this.runAll("stop"), this.animations = animations2.filter(Boolean);
15915
+ }
15916
+ get finished() {
15917
+ return Promise.all(this.animations.map((animation) => animation.finished));
15918
+ }
15919
+ /**
15920
+ * TODO: Filter out cancelled or stopped animations before returning
15921
+ */
15922
+ getAll(propName) {
15923
+ return this.animations[0][propName];
15924
+ }
15925
+ setAll(propName, newValue) {
15926
+ for (let i2 = 0; i2 < this.animations.length; i2++)
15927
+ this.animations[i2][propName] = newValue;
15928
+ }
15929
+ attachTimeline(timeline, fallback) {
15930
+ const subscriptions = this.animations.map((animation) => {
15931
+ if (supportsScrollTimeline() && animation.attachTimeline)
15932
+ return animation.attachTimeline(timeline);
15933
+ if (typeof fallback == "function")
15934
+ return fallback(animation);
15935
+ });
15936
+ return () => {
15937
+ subscriptions.forEach((cancel2, i2) => {
15938
+ cancel2 && cancel2(), this.animations[i2].stop();
15939
+ });
15940
+ };
15941
+ }
15942
+ get time() {
15943
+ return this.getAll("time");
15944
+ }
15945
+ set time(time2) {
15946
+ this.setAll("time", time2);
15947
+ }
15948
+ get speed() {
15949
+ return this.getAll("speed");
15950
+ }
15951
+ set speed(speed) {
15952
+ this.setAll("speed", speed);
15953
+ }
15954
+ get startTime() {
15955
+ return this.getAll("startTime");
15956
+ }
15957
+ get duration() {
15958
+ let max2 = 0;
15959
+ for (let i2 = 0; i2 < this.animations.length; i2++)
15960
+ max2 = Math.max(max2, this.animations[i2].duration);
15961
+ return max2;
15962
+ }
15963
+ runAll(methodName) {
15964
+ this.animations.forEach((controls) => controls[methodName]());
15965
+ }
15966
+ flatten() {
15967
+ this.runAll("flatten");
15968
+ }
15969
+ play() {
15970
+ this.runAll("play");
15971
+ }
15972
+ pause() {
15973
+ this.runAll("pause");
15974
+ }
15975
+ cancel() {
15976
+ this.runAll("cancel");
15977
+ }
15978
+ complete() {
15979
+ this.runAll("complete");
15980
+ }
15981
+ }
15982
+ class GroupAnimationWithThen extends GroupAnimation {
15983
+ then(onResolve, _onReject) {
15984
+ return this.finished.finally(onResolve).then(() => {
15985
+ });
15986
+ }
15987
+ }
15983
15988
  const animateMotionValue = (name, value, target, transition = {}, element, isHandoff) => (onComplete) => {
15984
15989
  const valueTransition = getValueTransition$1(transition, name) || {}, delay2 = valueTransition.delay || transition.delay || 0;
15985
15990
  let { elapsed = 0 } = transition;
@@ -16291,20 +16296,7 @@ const animations = {
16291
16296
  exit: {
16292
16297
  Feature: ExitAnimationFeature
16293
16298
  }
16294
- }, isDragging = {
16295
- x: !1,
16296
- y: !1
16297
16299
  };
16298
- function isDragActive() {
16299
- return isDragging.x || isDragging.y;
16300
- }
16301
- function setDragLock(axis) {
16302
- return axis === "x" || axis === "y" ? isDragging[axis] ? null : (isDragging[axis] = !0, () => {
16303
- isDragging[axis] = !1;
16304
- }) : isDragging.x || isDragging.y ? null : (isDragging.x = isDragging.y = !0, () => {
16305
- isDragging.x = isDragging.y = !1;
16306
- });
16307
- }
16308
16300
  function addDomEvent(target, eventName, handler, options = { passive: !0 }) {
16309
16301
  return target.addEventListener(eventName, handler, options), () => target.removeEventListener(eventName, handler);
16310
16302
  }
@@ -16572,6 +16564,20 @@ function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
16572
16564
  function resolvePointElastic(dragElastic, label2) {
16573
16565
  return typeof dragElastic == "number" ? dragElastic : dragElastic[label2] || 0;
16574
16566
  }
16567
+ const isDragging = {
16568
+ x: !1,
16569
+ y: !1
16570
+ };
16571
+ function isDragActive() {
16572
+ return isDragging.x || isDragging.y;
16573
+ }
16574
+ function setDragLock(axis) {
16575
+ return axis === "x" || axis === "y" ? isDragging[axis] ? null : (isDragging[axis] = !0, () => {
16576
+ isDragging[axis] = !1;
16577
+ }) : isDragging.x || isDragging.y ? null : (isDragging.x = isDragging.y = !0, () => {
16578
+ isDragging.x = isDragging.y = !1;
16579
+ });
16580
+ }
16575
16581
  const elementDragControls = /* @__PURE__ */ new WeakMap();
16576
16582
  class VisualElementDragControls {
16577
16583
  constructor(visualElement) {
@@ -16970,12 +16976,7 @@ function delay(callback, timeout2) {
16970
16976
  }
16971
16977
  const borders = ["TopLeft", "TopRight", "BottomLeft", "BottomRight"], numBorders = borders.length, asNumber = (value) => typeof value == "string" ? parseFloat(value) : value, isPx = (value) => typeof value == "number" || px.test(value);
16972
16978
  function mixValues(target, follow, lead, progress2, shouldCrossfadeOpacity, isOnlyMember) {
16973
- shouldCrossfadeOpacity ? (target.opacity = mixNumber$1(
16974
- 0,
16975
- // TODO Reinstate this if only child
16976
- lead.opacity !== void 0 ? lead.opacity : 1,
16977
- easeCrossfadeIn(progress2)
16978
- ), target.opacityExit = mixNumber$1(follow.opacity !== void 0 ? follow.opacity : 1, 0, easeCrossfadeOut(progress2))) : isOnlyMember && (target.opacity = mixNumber$1(follow.opacity !== void 0 ? follow.opacity : 1, lead.opacity !== void 0 ? lead.opacity : 1, progress2));
16979
+ shouldCrossfadeOpacity ? (target.opacity = mixNumber$1(0, lead.opacity ?? 1, easeCrossfadeIn(progress2)), target.opacityExit = mixNumber$1(follow.opacity ?? 1, 0, easeCrossfadeOut(progress2))) : isOnlyMember && (target.opacity = mixNumber$1(follow.opacity ?? 1, lead.opacity ?? 1, progress2));
16979
16980
  for (let i2 = 0; i2 < numBorders; i2++) {
16980
16981
  const borderLabel = `border${borders[i2]}Radius`;
16981
16982
  let followRadius = getRadius(follow, borderLabel), leadRadius = getRadius(lead, borderLabel);
@@ -25231,12 +25232,7 @@ let epoch = 0, atom = (initialValue) => {
25231
25232
  epoch++;
25232
25233
  let runListenerQueue = !listenerQueue.length;
25233
25234
  for (let listener of listeners)
25234
- listenerQueue.push(
25235
- listener,
25236
- $atom.value,
25237
- oldValue,
25238
- changedKey
25239
- );
25235
+ listenerQueue.push(listener, $atom.value, oldValue, changedKey);
25240
25236
  if (runListenerQueue) {
25241
25237
  for (lqIndex = 0; lqIndex < listenerQueue.length; lqIndex += QUEUE_ITEMS_PER_LISTENER)
25242
25238
  listenerQueue[lqIndex](
@@ -29054,7 +29050,7 @@ function focusedBounds(params) {
29054
29050
  }
29055
29051
  const DiagramActorSafeContext = createContext(null);
29056
29052
  DiagramActorSafeContext.displayName = "DiagramActorSafeContext";
29057
- const useDiagramActorRef = () => {
29053
+ const DiagramActorContextProvider = DiagramActorSafeContext.Provider, useDiagramActorRef = () => {
29058
29054
  const ctx = useContext(DiagramActorSafeContext);
29059
29055
  if (ctx === null)
29060
29056
  throw new Error("DiagramActorRef is not provided");
@@ -30044,7 +30040,7 @@ function CompoundTitle({ id: id2, data }) {
30044
30040
  }
30045
30041
  );
30046
30042
  }
30047
- const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, edgePropsEqual = (prev, next) => prev.id === next.id && deepEqual(prev.selected ?? !1, next.selected ?? !1) && deepEqual(prev.source, next.source) && deepEqual(prev.sourceHandleId ?? null, next.sourceHandleId ?? null) && deepEqual(prev.sourcePosition, next.sourcePosition) && deepEqual(prev.target, next.target) && deepEqual(prev.targetHandleId ?? null, next.targetHandleId ?? null) && deepEqual(prev.targetPosition, next.targetPosition) && isSame(prev.sourceX, next.sourceX) && isSame(prev.sourceY, next.sourceY) && isSame(prev.targetX, next.targetX) && isSame(prev.targetY, next.targetY) && deepEqual(prev.data, next.data);
30043
+ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, edgePropsEqual = (prev, next) => prev.id === next.id && deepEqual(prev.selected ?? !1, next.selected ?? !1) && deepEqual(prev.animated ?? !1, next.animated ?? !1) && deepEqual(prev.source, next.source) && deepEqual(prev.sourceHandleId ?? null, next.sourceHandleId ?? null) && deepEqual(prev.sourcePosition, next.sourcePosition) && deepEqual(prev.target, next.target) && deepEqual(prev.targetHandleId ?? null, next.targetHandleId ?? null) && deepEqual(prev.targetPosition, next.targetPosition) && isSame(prev.sourceX, next.sourceX) && isSame(prev.sourceY, next.sourceY) && isSame(prev.targetX, next.targetX) && isSame(prev.targetY, next.targetY) && deepEqual(prev.data, next.data);
30048
30044
  function customEdge(Edge) {
30049
30045
  return memo$3(Edge, edgePropsEqual);
30050
30046
  }
@@ -30320,6 +30316,9 @@ const translate = {
30320
30316
  padding: "0px"
30321
30317
  },
30322
30318
  labelContents: {
30319
+ display: "flex",
30320
+ flexDirection: "column",
30321
+ alignItems: "center",
30323
30322
  padding: "2px 5px 4px 0px"
30324
30323
  },
30325
30324
  labelText: {
@@ -30348,9 +30347,9 @@ function EdgeLabel({
30348
30347
  const stepNum = isStepEdgeId(id2) ? extractStep(id2) : null, classes2 = labelsva({
30349
30348
  isStepEdge: stepNum !== null
30350
30349
  });
30351
- return /* @__PURE__ */ jsxs(Box$1, { className: cx(classes2.root, className), ...rest, children: [
30352
- stepNum !== null && /* @__PURE__ */ jsx(Box$1, { className: classes2.stepNumber, children: stepNum }),
30353
- /* @__PURE__ */ jsxs(Box$1, { className: classes2.labelContents, children: [
30350
+ return /* @__PURE__ */ jsxs(Box, { className: cx(classes2.root, className), ...rest, children: [
30351
+ stepNum !== null && /* @__PURE__ */ jsx(Box, { className: classes2.stepNumber, children: stepNum }),
30352
+ /* @__PURE__ */ jsxs(Box, { className: classes2.labelContents, children: [
30354
30353
  n$5(label2) && /* @__PURE__ */ jsx(Text, { component: "div", className: classes2.labelText, lineClamp: 5, children: label2 }),
30355
30354
  n$5(technology2) && /* @__PURE__ */ jsx(Text, { component: "div", className: classes2.labelTechnology, children: "[ " + technology2 + " ]" }),
30356
30355
  children2
@@ -37385,7 +37384,7 @@ function ElementDetails({
37385
37384
  })),
37386
37385
  shallowEqual
37387
37386
  );
37388
- return /* @__PURE__ */ jsx(ElementDetailsActorContext, { value: actorRef, children: /* @__PURE__ */ jsx(
37387
+ return /* @__PURE__ */ jsx(ElementDetailsActorContext.Provider, { value: actorRef, children: /* @__PURE__ */ jsx(
37389
37388
  ElementDetailsCard,
37390
37389
  {
37391
37390
  onClose,
@@ -41134,7 +41133,7 @@ const autolayoutButton = css({
41134
41133
  translateY: -10
41135
41134
  },
41136
41135
  align: "flex-start",
41137
- className: clsx(
41136
+ className: cx(
41138
41137
  "react-flow__panel",
41139
41138
  panel,
41140
41139
  "likec4-top-left-panel"
@@ -41146,7 +41145,7 @@ const autolayoutButton = css({
41146
41145
  /* @__PURE__ */ jsx(LayoutGroup, { children: /* @__PURE__ */ jsxs(
41147
41146
  Group,
41148
41147
  {
41149
- className: clsx(navigationButtons, "likec4-navigation-webview"),
41148
+ className: cx(navigationButtons, "likec4-navigation-webview"),
41150
41149
  gap: "xs",
41151
41150
  children: [
41152
41151
  burgerMenu,
@@ -43135,6 +43134,7 @@ const diagramMachine = setup({
43135
43134
  "enabled: FitView": ({ context: context2 }) => context2.features.enableFitView,
43136
43135
  "enabled: FocusMode": ({ context: context2 }) => context2.features.enableFocusMode,
43137
43136
  "enabled: Readonly": ({ context: context2 }) => context2.features.enableReadOnly,
43137
+ "enabled: RelationshipDetails": ({ context: context2 }) => context2.features.enableRelationshipDetails,
43138
43138
  "not readonly": ({ context: context2 }) => !context2.features.enableReadOnly,
43139
43139
  "is dynamic view": ({ context: context2 }) => context2.view.__ === "dynamic",
43140
43140
  "is another view": ({ context: context2, event }) => {
@@ -43147,7 +43147,8 @@ const diagramMachine = setup({
43147
43147
  "click: selected node": ({ event }) => (assertEvent(event, "xyflow.nodeClick"), event.node.selected === !0),
43148
43148
  "click: same node": ({ context: context2, event }) => (assertEvent(event, "xyflow.nodeClick"), context2.lastClickedNode?.id === event.node.id),
43149
43149
  "click: focused node": ({ context: context2, event }) => (assertEvent(event, "xyflow.nodeClick"), context2.focusedNode === event.node.id),
43150
- "click: node has connections": ({ context: context2, event }) => (assertEvent(event, "xyflow.nodeClick"), context2.xyedges.some((e2) => e2.source === event.node.id || e2.target === event.node.id))
43150
+ "click: node has connections": ({ context: context2, event }) => (assertEvent(event, "xyflow.nodeClick"), context2.xyedges.some((e2) => e2.source === event.node.id || e2.target === event.node.id)),
43151
+ "click: selected edge": ({ event }) => (assertEvent(event, "xyflow.edgeClick"), event.edge.selected === !0 || event.edge.data.active === !0)
43151
43152
  },
43152
43153
  actions: {
43153
43154
  "trigger:NavigateTo": (_, _params) => {
@@ -43578,7 +43579,27 @@ const diagramMachine = setup({
43578
43579
  focusedNode: ({ event }) => event.nodeId
43579
43580
  }),
43580
43581
  target: "focused"
43581
- }
43582
+ },
43583
+ "xyflow.edgeClick": [{
43584
+ guard: and([
43585
+ "is dynamic view",
43586
+ "click: selected edge"
43587
+ ]),
43588
+ actions: raise(({ event }) => ({
43589
+ type: "walkthrough.start",
43590
+ stepId: event.edge.id
43591
+ }))
43592
+ }, {
43593
+ guard: and([
43594
+ "enabled: RelationshipDetails",
43595
+ "click: selected edge"
43596
+ ]),
43597
+ actions: sendTo(({ system }) => typedSystem(system).overlaysActorRef, ({ context: context2, event }) => ({
43598
+ type: "open.relationshipDetails",
43599
+ viewId: context2.view.id,
43600
+ edgeId: event.edge.id
43601
+ }))
43602
+ }]
43582
43603
  }
43583
43604
  },
43584
43605
  focused: {
@@ -43591,12 +43612,12 @@ const diagramMachine = setup({
43591
43612
  spawnChild("hotkeyActorLogic", { id: "hotkey" }),
43592
43613
  "xyflow:fitFocusedBounds"
43593
43614
  ],
43594
- exit: enqueueActions(({ enqueue, context: context2 }) => {
43595
- enqueue.stopChild("hotkey"), context2.viewportBeforeFocus ? enqueue({ type: "xyflow:setViewport", params: { viewport: context2.viewportBeforeFocus } }) : enqueue({ type: "xyflow:fitDiagram" }), enqueue.assign((s2) => ({
43596
- ...unfocusNodesEdges(s2),
43615
+ exit: enqueueActions(({ enqueue, context: context2, event }) => {
43616
+ enqueue.stopChild("hotkey"), context2.viewportBeforeFocus ? enqueue({ type: "xyflow:setViewport", params: { viewport: context2.viewportBeforeFocus } }) : enqueue({ type: "xyflow:fitDiagram" }), enqueue.assign({
43617
+ ...unfocusNodesEdges({ context: context2 }),
43597
43618
  viewportBeforeFocus: null,
43598
43619
  focusedNode: null
43599
- }));
43620
+ });
43600
43621
  }),
43601
43622
  on: {
43602
43623
  "xyflow.nodeClick": [
@@ -43686,6 +43707,18 @@ const diagramMachine = setup({
43686
43707
  }), enqueue.assign(updateActiveWalkthrough), enqueue("xyflow:fitFocusedBounds");
43687
43708
  })
43688
43709
  },
43710
+ "xyflow.edgeClick": {
43711
+ actions: [
43712
+ assign(({ event, context: context2 }) => !isStepEdgeId(event.edge.id) || event.edge.id === context2.activeWalkthrough?.stepId ? {} : {
43713
+ activeWalkthrough: {
43714
+ stepId: event.edge.id,
43715
+ parallelPrefix: getParallelStepsPrefix(event.edge.id)
43716
+ }
43717
+ }),
43718
+ assign(updateActiveWalkthrough),
43719
+ "xyflow:fitFocusedBounds"
43720
+ ]
43721
+ },
43689
43722
  "notations.unhighlight": {
43690
43723
  actions: assign((s2) => ({
43691
43724
  ...updateActiveWalkthrough(s2)
@@ -43901,7 +43934,7 @@ function DiagramActorProvider({
43901
43934
  actorRef.send({ type: "update.view", view, xyedges, xynodes });
43902
43935
  }, [view, xyedges, xynodes]);
43903
43936
  const toggledFeatures = useSelector(actorRef, selectToggledFeatures, shallowEqual);
43904
- return /* @__PURE__ */ jsx(DiagramActorSafeContext, { value: actorRef, children: /* @__PURE__ */ jsx(DiagramFeatures, { overrides: toggledFeatures, children: children2 }) });
43937
+ return /* @__PURE__ */ jsx(DiagramActorContextProvider, { value: actorRef, children: /* @__PURE__ */ jsx(DiagramFeatures, { overrides: toggledFeatures, children: children2 }) });
43905
43938
  }
43906
43939
  function LikeC4Diagram({
43907
43940
  onCanvasClick,