likec4 1.15.1 → 1.16.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "likec4",
3
- "version": "1.15.1",
3
+ "version": "1.16.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://likec4.dev",
6
6
  "author": "Denis Davydkov <denis@davydkov.com>",
@@ -98,7 +98,7 @@
98
98
  "dependencies": {
99
99
  "@hpcc-js/wasm-graphviz": "1.6.1",
100
100
  "@vitejs/plugin-react-swc": "3.7.1",
101
- "playwright": "1.47.2",
101
+ "playwright": "1.48.2",
102
102
  "react": "^18.3.1",
103
103
  "react-dom": "^18.3.1",
104
104
  "type-fest": "4.26.1",
@@ -106,14 +106,14 @@
106
106
  },
107
107
  "devDependencies": {
108
108
  "@fontsource/ibm-plex-sans": "^5.1.0",
109
- "@likec4/core": "1.15.1",
110
- "@likec4/diagram": "1.15.1",
111
- "@likec4/generators": "1.15.1",
112
- "@likec4/icons": "1.15.1",
113
- "@likec4/language-server": "1.15.1",
114
- "@likec4/layouts": "1.15.1",
115
- "@likec4/log": "1.15.1",
116
- "@likec4/tsconfig": "1.15.1",
109
+ "@likec4/core": "1.16.0",
110
+ "@likec4/diagram": "1.16.0",
111
+ "@likec4/generators": "1.16.0",
112
+ "@likec4/icons": "1.16.0",
113
+ "@likec4/language-server": "1.16.0",
114
+ "@likec4/layouts": "1.16.0",
115
+ "@likec4/log": "1.16.0",
116
+ "@likec4/tsconfig": "1.16.0",
117
117
  "@mantine/core": "7.13.4",
118
118
  "@mantine/hooks": "7.13.4",
119
119
  "@mantine/vanilla-extract": "7.13.4",
@@ -144,7 +144,7 @@
144
144
  "execa": "^9.3.1",
145
145
  "fast-equals": "^5.0.1",
146
146
  "fdir": "^6.4.2",
147
- "framer-motion": "^11.11.9",
147
+ "framer-motion": "^11.11.10",
148
148
  "get-port": "^7.1.0",
149
149
  "glob": "^11.0.0",
150
150
  "html-to-image": "^1.11.11",
@@ -158,8 +158,9 @@
158
158
  "postcss": "^8.4.47",
159
159
  "postcss-preset-mantine": "^1.17.0",
160
160
  "pretty-ms": "^9.1.0",
161
+ "prop-types": "^15.8.1",
161
162
  "react-error-boundary": "^4.1.2",
162
- "react-resizable-panels": "^2.1.4",
163
+ "react-resizable-panels": "^2.1.6",
163
164
  "react-shadow": "^20.5.0",
164
165
  "remeda": "^2.16.0",
165
166
  "std-env": "^3.7.0",
@@ -174,7 +175,7 @@
174
175
  "unbuild": "^3.0.0-rc.11",
175
176
  "vite-plugin-css-injected-by-js": "^3.5.2",
176
177
  "vite-plugin-shadow-style": "^1.1.1",
177
- "vitest": "^2.1.3",
178
+ "vitest": "^2.1.4",
178
179
  "yargs": "17.7.2"
179
180
  },
180
181
  "packageManager": "yarn@4.5.1"
package/react/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
3
  import { CSSProperties, DependencyList, HTMLAttributes, MouseEvent as ReactMouseEvent, PropsWithChildren, ReactNode } from 'react';
4
- import { Class, LiteralUnion, OverrideProperties, PartialDeep, Tagged, TupleToUnion } from 'type-fest';
4
+ import { Class, LiteralUnion, NonEmptyTuple, OverrideProperties, PartialDeep, Tagged, TupleToUnion } from 'type-fest';
5
5
 
6
6
  type NonEmptyArray<T> = [
7
7
  T,
@@ -139,10 +139,15 @@ type OrOperator<Tag, Kind> = Omit<AllNever, "or"> & {
139
139
  or: NonEmptyArray<WhereOperator<Tag, Kind>>;
140
140
  };
141
141
  type WhereOperator<Tag, Kind> = TagEqual<Tag> | KindEqual<Kind> | NotOperator<Tag, Kind> | AndOperator<Tag, Kind> | OrOperator<Tag, Kind>;
142
+ type GlobalPredicateId = Tagged<string, "GlobalPredicateId">;
143
+ type GlobalPredicates = NonEmptyArray<ViewRulePredicate>;
144
+ type GlobalDynamicPredicates = NonEmptyArray<DynamicViewIncludeRule>;
142
145
  type GlobalStyleID = Tagged<string, "GlobalStyleID">;
143
- interface GlobalStyle {
144
- readonly id: GlobalStyleID;
145
- readonly styles: NonEmptyArray<ViewRuleStyle>;
146
+ type GlobalStyles = NonEmptyTuple<ViewRuleStyle>;
147
+ interface ModelGlobals {
148
+ predicates: Record<GlobalPredicateId, GlobalPredicates>;
149
+ dynamicPredicates: Record<GlobalPredicateId, GlobalDynamicPredicates>;
150
+ styles: Record<GlobalStyleID, GlobalStyles>;
146
151
  }
147
152
  type ElementNotation = {
148
153
  kinds: ElementKind[];
@@ -158,6 +163,9 @@ type ViewRulePredicate = {
158
163
  include?: never;
159
164
  exclude: Expression[];
160
165
  };
166
+ interface ViewRuleGlobalPredicateRef {
167
+ predicateId: GlobalPredicateId;
168
+ }
161
169
  interface ViewRuleStyle {
162
170
  targets: ElementExpression[];
163
171
  notation?: string;
@@ -183,7 +191,7 @@ interface ViewRuleGroup {
183
191
  border?: BorderStyle;
184
192
  opacity?: number;
185
193
  }
186
- type ViewRule = ViewRulePredicate | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
194
+ type ViewRule = ViewRulePredicate | ViewRuleGlobalPredicateRef | ViewRuleGroup | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
187
195
  interface BasicView<ViewType extends "element" | "dynamic", ViewIDs extends string, Tags extends string> {
188
196
  readonly __?: ViewType;
189
197
  readonly id: ViewID<ViewIDs>;
@@ -245,7 +253,7 @@ type DynamicViewStepOrParallel = DynamicViewStep | DynamicViewParallelSteps;
245
253
  type DynamicViewIncludeRule = {
246
254
  include: ElementPredicateExpression[];
247
255
  };
248
- type DynamicViewRule = DynamicViewIncludeRule | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
256
+ type DynamicViewRule = DynamicViewIncludeRule | ViewRuleGlobalPredicateRef | ViewRuleStyle | ViewRuleGlobalStyle | ViewRuleAutoLayout;
249
257
  interface DynamicView<ViewIDs extends string = string, Tags extends string = string> extends BasicView<"dynamic", ViewIDs, Tags> {
250
258
  readonly __: "dynamic";
251
259
  readonly steps: DynamicViewStepOrParallel[];
@@ -547,9 +555,7 @@ interface ParsedLikeC4Model<ElementKinds extends string = string, RelationKinds
547
555
  };
548
556
  elements: Record<Fqns, TypedElement<Fqns, ElementKinds, Tags>>;
549
557
  relations: Record<RelationID, Relation>;
550
- globals: {
551
- styles: Record<GlobalStyleID, GlobalStyle>;
552
- };
558
+ globals: ModelGlobals;
553
559
  views: Record<Views, LikeC4View<Views, Tags>>;
554
560
  }
555
561
  interface ComputedLikeC4Model extends Omit<ParsedLikeC4Model, "views"> {
package/react/index.mjs CHANGED
@@ -7937,7 +7937,7 @@ class MotionValue {
7937
7937
  * @internal
7938
7938
  */
7939
7939
  constructor(init2, options = {}) {
7940
- this.version = "11.11.9", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (v2, render = !0) => {
7940
+ this.version = "11.11.10", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (v2, render = !0) => {
7941
7941
  const currentTime = time$1.now();
7942
7942
  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);
7943
7943
  }, this.hasAnimated = !1, this.setCurrent(init2), this.owner = options.owner;
@@ -8145,8 +8145,6 @@ function isWillChangeMotionValue(value) {
8145
8145
  return !!(isMotionValue(value) && value.add);
8146
8146
  }
8147
8147
  function addValueToWillChange(visualElement, key) {
8148
- if (!visualElement.applyWillChange)
8149
- return;
8150
8148
  const willChange = visualElement.getValue("willChange");
8151
8149
  if (isWillChangeMotionValue(willChange))
8152
8150
  return willChange.add(key);
@@ -10320,7 +10318,7 @@ function scrapeMotionValuesFromProps$1(props, prevProps, visualElement) {
10320
10318
  const { style: style2 } = props, newValues = {};
10321
10319
  for (const key in style2)
10322
10320
  (isMotionValue(style2[key]) || prevProps.style && isMotionValue(prevProps.style[key]) || isForcedMotionValue(key, props) || ((_a3 = visualElement == null ? void 0 : visualElement.getValue(key)) === null || _a3 === void 0 ? void 0 : _a3.liveStyle) !== void 0) && (newValues[key] = style2[key]);
10323
- return visualElement && style2 && typeof style2.willChange == "string" && (visualElement.applyWillChange = !1), newValues;
10321
+ return newValues;
10324
10322
  }
10325
10323
  function scrapeMotionValuesFromProps(props, prevProps, visualElement) {
10326
10324
  const newValues = scrapeMotionValuesFromProps$1(props, prevProps, visualElement);
@@ -10335,36 +10333,19 @@ function useConstant(init2) {
10335
10333
  const ref = useRef(null);
10336
10334
  return ref.current === null && (ref.current = init2()), ref.current;
10337
10335
  }
10338
- function getWillChangeName(name) {
10339
- if (transformProps.has(name))
10340
- return "transform";
10341
- if (acceleratedValues.has(name))
10342
- return camelToDash(name);
10343
- }
10344
- function makeState({ applyWillChange = !1, scrapeMotionValuesFromProps: scrapeMotionValuesFromProps2, createRenderState, onMount: onMount2 }, props, context, presenceContext, isStatic) {
10336
+ function makeState({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps2, createRenderState, onMount: onMount2 }, props, context, presenceContext) {
10345
10337
  const state = {
10346
- latestValues: makeLatestValues(props, context, presenceContext, isStatic ? !1 : applyWillChange, scrapeMotionValuesFromProps2),
10338
+ latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps2),
10347
10339
  renderState: createRenderState()
10348
10340
  };
10349
10341
  return onMount2 && (state.mount = (instance) => onMount2(props, instance, state)), state;
10350
10342
  }
10351
10343
  const makeUseVisualState = (config) => (props, isStatic) => {
10352
- const context = useContext(MotionContext), presenceContext = useContext(PresenceContext), make = () => makeState(config, props, context, presenceContext, isStatic);
10344
+ const context = useContext(MotionContext), presenceContext = useContext(PresenceContext), make = () => makeState(config, props, context, presenceContext);
10353
10345
  return isStatic ? make() : useConstant(make);
10354
10346
  };
10355
- function forEachDefinition(props, definition, callback) {
10356
- const list2 = Array.isArray(definition) ? definition : [definition];
10357
- for (let i2 = 0; i2 < list2.length; i2++) {
10358
- const resolved = resolveVariantFromProps(props, list2[i2]);
10359
- if (resolved) {
10360
- const { transitionEnd, transition, ...target } = resolved;
10361
- callback(target, transitionEnd);
10362
- }
10363
- }
10364
- }
10365
- function makeLatestValues(props, context, presenceContext, shouldApplyWillChange, scrapeMotionValues) {
10366
- var _a3;
10367
- const values2 = {}, willChange = /* @__PURE__ */ new Set(), applyWillChange = shouldApplyWillChange && ((_a3 = props.style) === null || _a3 === void 0 ? void 0 : _a3.willChange) === void 0, motionValues = scrapeMotionValues(props, {});
10347
+ function makeLatestValues(props, context, presenceContext, scrapeMotionValues) {
10348
+ const values2 = {}, motionValues = scrapeMotionValues(props, {});
10368
10349
  for (const key in motionValues)
10369
10350
  values2[key] = resolveMotionValue(motionValues[key]);
10370
10351
  let { initial, animate } = props;
@@ -10373,23 +10354,26 @@ function makeLatestValues(props, context, presenceContext, shouldApplyWillChange
10373
10354
  let isInitialAnimationBlocked = presenceContext ? presenceContext.initial === !1 : !1;
10374
10355
  isInitialAnimationBlocked = isInitialAnimationBlocked || initial === !1;
10375
10356
  const variantToSet = isInitialAnimationBlocked ? animate : initial;
10376
- return variantToSet && typeof variantToSet != "boolean" && !isAnimationControls(variantToSet) && forEachDefinition(props, variantToSet, (target, transitionEnd) => {
10377
- for (const key in target) {
10378
- let valueTarget = target[key];
10379
- if (Array.isArray(valueTarget)) {
10380
- const index2 = isInitialAnimationBlocked ? valueTarget.length - 1 : 0;
10381
- valueTarget = valueTarget[index2];
10357
+ if (variantToSet && typeof variantToSet != "boolean" && !isAnimationControls(variantToSet)) {
10358
+ const list2 = Array.isArray(variantToSet) ? variantToSet : [variantToSet];
10359
+ for (let i2 = 0; i2 < list2.length; i2++) {
10360
+ const resolved = resolveVariantFromProps(props, list2[i2]);
10361
+ if (resolved) {
10362
+ const { transitionEnd, transition, ...target } = resolved;
10363
+ for (const key in target) {
10364
+ let valueTarget = target[key];
10365
+ if (Array.isArray(valueTarget)) {
10366
+ const index2 = isInitialAnimationBlocked ? valueTarget.length - 1 : 0;
10367
+ valueTarget = valueTarget[index2];
10368
+ }
10369
+ valueTarget !== null && (values2[key] = valueTarget);
10370
+ }
10371
+ for (const key in transitionEnd)
10372
+ values2[key] = transitionEnd[key];
10382
10373
  }
10383
- valueTarget !== null && (values2[key] = valueTarget);
10384
- }
10385
- for (const key in transitionEnd)
10386
- values2[key] = transitionEnd[key];
10387
- }), applyWillChange && (animate && initial !== !1 && !isAnimationControls(animate) && forEachDefinition(props, animate, (target) => {
10388
- for (const name in target) {
10389
- const memberName = getWillChangeName(name);
10390
- memberName && willChange.add(memberName);
10391
10374
  }
10392
- }), willChange.size && (values2.willChange = Array.from(willChange).join(","))), values2;
10375
+ }
10376
+ return values2;
10393
10377
  }
10394
10378
  const createHtmlRenderState = () => ({
10395
10379
  style: {},
@@ -10509,7 +10493,6 @@ const isSVGTag = (tag) => typeof tag == "string" && tag.toLowerCase() === "svg",
10509
10493
  })
10510
10494
  }, htmlMotionConfig = {
10511
10495
  useVisualState: makeUseVisualState({
10512
- applyWillChange: !0,
10513
10496
  scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1,
10514
10497
  createRenderState: createHtmlRenderState
10515
10498
  })
@@ -10664,7 +10647,7 @@ class VisualElement {
10664
10647
  return {};
10665
10648
  }
10666
10649
  constructor({ parent, props, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState }, options = {}) {
10667
- this.applyWillChange = !1, this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = KeyframeResolver, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
10650
+ this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = KeyframeResolver, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
10668
10651
  this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
10669
10652
  }, this.renderScheduledAt = 0, this.scheduleRender = () => {
10670
10653
  const now2 = time$1.now();
@@ -10864,7 +10847,7 @@ function getComputedStyle$2(element) {
10864
10847
  }
10865
10848
  class HTMLVisualElement extends DOMVisualElement {
10866
10849
  constructor() {
10867
- super(...arguments), this.type = "html", this.applyWillChange = !0, this.renderInstance = renderHTML;
10850
+ super(...arguments), this.type = "html", this.renderInstance = renderHTML;
10868
10851
  }
10869
10852
  readValueFromInstance(instance, key) {
10870
10853
  if (transformProps.has(key)) {