@likec4/diagram 1.58.0 → 1.59.1
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/dist/LikeC4Diagram.js +1 -1
- package/dist/LikeC4Diagram.props.d.ts +1 -1
- package/dist/LikeC4Styles.js +1 -1
- package/dist/LikeC4View.js +2 -2
- package/dist/ReactLikeC4.d.ts +1 -1
- package/dist/base/Base.d.ts +3 -2
- package/dist/base/Base.js +14 -26
- package/dist/base/BaseXYFlow.d.ts +2 -1
- package/dist/base/BaseXYFlow.js +63 -4
- package/dist/base/keyboardZoom.d.ts +3 -0
- package/dist/base/keyboardZoom.js +20 -0
- package/dist/base/updateEdges.js +7 -16
- package/dist/base/updateNodes.js +3 -9
- package/dist/base-primitives/compound/CompoundActionButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundActionButton.js +5 -2
- package/dist/base-primitives/compound/CompoundDetailsButton.d.ts +2 -1
- package/dist/base-primitives/compound/CompoundDetailsButton.js +5 -2
- package/dist/base-primitives/compound/CompoundTitle.d.ts +7 -1
- package/dist/base-primitives/compound/CompoundTitle.js +2 -1
- package/dist/base-primitives/compound/actionbtns.css.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeActionButton.d.ts +2 -1
- package/dist/base-primitives/edge/EdgeActionButton.js +2 -1
- package/dist/base-primitives/edge/EdgeContainer.d.ts +1 -1
- package/dist/base-primitives/edge/EdgeContainer.js +4 -2
- package/dist/base-primitives/edge/EdgeLabel.d.ts +2 -0
- package/dist/base-primitives/edge/EdgeLabel.js +2 -5
- package/dist/base-primitives/element/ElementActionButtons.d.ts +1 -0
- package/dist/base-primitives/element/ElementActionButtons.js +4 -1
- package/dist/base-primitives/element/ElementData.d.ts +3 -1
- package/dist/base-primitives/element/ElementData.js +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.d.ts +2 -1
- package/dist/base-primitives/element/ElementDetailsButton.js +5 -2
- package/dist/base-primitives/element/ElementNodeContainer.js +1 -1
- package/dist/base-primitives/element/ElementShape.js +3 -0
- package/dist/components/ErrorFallback.js +3 -5
- package/dist/components/Link.js +6 -6
- package/dist/components/NavigationPanel.js +1 -1
- package/dist/components/SearchControl.css.js +11 -11
- package/dist/context/TagStylesContext.d.ts +3 -3
- package/dist/context/TagStylesContext.js +16 -16
- package/dist/custom/index.d.ts +1 -0
- package/dist/custom/index.js +3 -2
- package/dist/editor/actor/actions.js +1 -1
- package/dist/editor/actor/machine.d.ts +4 -6
- package/dist/editor/actor/setup.d.ts +16 -2
- package/dist/editor/actor/setup.js +5 -4
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/safeContext.d.ts +156 -3
- package/dist/hooks/safeContext.js +60 -12
- package/dist/hooks/useCurrentViewModel.js +1 -1
- package/dist/hooks/useDiagram.d.ts +8 -0
- package/dist/hooks/useDiagram.js +9 -2
- package/dist/hooks/useEditorActor.js +1 -1
- package/dist/hooks/useLikeC4ElementsTree.js +1 -1
- package/dist/hooks/useLikeC4Model.js +1 -1
- package/dist/hooks/useXYFlow.d.ts +1 -0
- package/dist/hooks/useXYFlow.js +5 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/likec4diagram/DiagramUI.js +19 -6
- package/dist/likec4diagram/DiagramXYFlow.js +39 -14
- package/dist/likec4diagram/convert-to-xyflow.d.ts +3 -5
- package/dist/likec4diagram/convert-to-xyflow.js +29 -10
- package/dist/likec4diagram/custom/edges/RelationshipEdge.js +13 -4
- package/dist/likec4diagram/custom/edges/SequenceStepEdge.js +11 -4
- package/dist/likec4diagram/custom/edges/edges.css.js +1 -1
- package/dist/likec4diagram/custom/index.d.ts +2 -1
- package/dist/likec4diagram/custom/index.js +5 -3
- package/dist/likec4diagram/custom/nodes/CompoundActions.js +1 -0
- package/dist/likec4diagram/custom/nodes/ElementActions.d.ts +2 -2
- package/dist/likec4diagram/custom/nodes/ElementActions.js +13 -3
- package/dist/likec4diagram/custom/nodes/NodeNotes.js +0 -4
- package/dist/likec4diagram/custom/nodes/SequenceActorNode.js +32 -19
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.d.ts +2 -0
- package/dist/likec4diagram/custom/nodes/SequenceSubFlow.js +234 -0
- package/dist/likec4diagram/custom/nodes/index.d.ts +1 -0
- package/dist/likec4diagram/custom/nodes/nodes.js +20 -5
- package/dist/likec4diagram/custom/nodes/toolbar/ColorButton.js +1 -1
- package/dist/likec4diagram/custom/nodes/toolbar/_shared.js +1 -1
- package/dist/likec4diagram/relationship-popover/RelationshipPopover.js +15 -14
- package/dist/likec4diagram/relationship-popover/components.d.ts +1 -1
- package/dist/likec4diagram/state/DiagramActorProvider.js +11 -20
- package/dist/likec4diagram/state/aligners.js +1 -1
- package/dist/likec4diagram/state/assign.d.ts +1 -1
- package/dist/likec4diagram/state/assign.js +1 -1
- package/dist/likec4diagram/state/createViewChange.js +1 -1
- package/dist/likec4diagram/state/diagram-api.d.ts +18 -10
- package/dist/likec4diagram/state/diagram-api.js +333 -229
- package/dist/likec4diagram/state/machine.actions.d.ts +1026 -332
- package/dist/likec4diagram/state/machine.actions.js +115 -44
- package/dist/likec4diagram/state/machine.actions.layout.d.ts +123 -51
- package/dist/likec4diagram/state/machine.actions.layout.js +40 -33
- package/dist/likec4diagram/state/machine.d.ts +154 -16
- package/dist/likec4diagram/state/machine.js +5 -41
- package/dist/likec4diagram/state/machine.setup.d.ts +84 -19
- package/dist/likec4diagram/state/machine.setup.js +65 -12
- package/dist/likec4diagram/state/machine.state.initializing.d.ts +59 -33
- package/dist/likec4diagram/state/machine.state.navigating.js +7 -3
- package/dist/likec4diagram/state/machine.state.ready.d.ts +1540 -476
- package/dist/likec4diagram/state/machine.state.ready.focused.d.ts +294 -53
- package/dist/likec4diagram/state/machine.state.ready.focused.js +3 -3
- package/dist/likec4diagram/state/machine.state.ready.idle.d.ts +264 -73
- package/dist/likec4diagram/state/machine.state.ready.idle.js +31 -6
- package/dist/likec4diagram/state/machine.state.ready.js +22 -16
- package/dist/likec4diagram/state/machine.state.ready.printing.d.ts +23 -9
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.d.ts +288 -84
- package/dist/likec4diagram/state/machine.state.ready.walkthrough.js +135 -66
- package/dist/likec4diagram/state/types.d.ts +4 -2
- package/dist/likec4diagram/state/utils.d.ts +7 -0
- package/dist/likec4diagram/state/utils.js +36 -34
- package/dist/likec4diagram/types.d.ts +47 -3
- package/dist/likec4diagram/ui/FloatingSequenceActors.d.ts +6 -0
- package/dist/likec4diagram/ui/FloatingSequenceActors.js +155 -0
- package/dist/likec4diagram/ui/LayoutDriftFrame.js +2 -2
- package/dist/likec4diagram/ui/index.d.ts +2 -0
- package/dist/likec4diagram/ui/notation/NotationPanel.css.js +5 -5
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.d.ts +2 -0
- package/dist/likec4diagram/ui/sequence-outline/SequenceOutlinePanel.js +540 -0
- package/dist/likec4diagram/ui/sequence-outline/state.d.ts +36 -0
- package/dist/likec4diagram/ui/sequence-outline/state.js +55 -0
- package/dist/likec4diagram/xyflow-diagram/diagram-view.d.ts +1 -1
- package/dist/likec4diagram/xyflow-diagram/diagram-view.js +112 -60
- package/dist/likec4diagram/xyflow-sequence/_types.d.ts +55 -5
- package/dist/likec4diagram/xyflow-sequence/const.d.ts +5 -5
- package/dist/likec4diagram/xyflow-sequence/const.js +4 -4
- package/dist/likec4diagram/xyflow-sequence/layouter.d.ts +30 -6
- package/dist/likec4diagram/xyflow-sequence/layouter.js +566 -0
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.d.ts → sequence-view-to-xy.d.ts} +8 -2
- package/dist/likec4diagram/xyflow-sequence/{sequence-layout.js → sequence-view-to-xy.js} +111 -14
- package/dist/likec4diagram/xyflow-sequence/sequence-view.d.ts +2 -7
- package/dist/likec4diagram/xyflow-sequence/sequence-view.js +144 -0
- package/dist/likec4diagram/xyflow-sequence/utils.d.ts +9 -1
- package/dist/likec4diagram/xyflow-sequence/utils.js +96 -0
- package/dist/navigationpanel/NavigationPanel.d.ts +5 -2
- package/dist/navigationpanel/NavigationPanel.js +58 -59
- package/dist/navigationpanel/NavigationPanelDropdown.js +45 -38
- package/dist/navigationpanel/_common.js +2 -2
- package/dist/navigationpanel/actor.actions.d.ts +19 -0
- package/dist/navigationpanel/actor.actions.js +45 -0
- package/dist/navigationpanel/actor.d.ts +34 -96
- package/dist/navigationpanel/actor.js +21 -84
- package/dist/navigationpanel/actor.setup.d.ts +98 -0
- package/dist/navigationpanel/actor.setup.js +31 -0
- package/dist/navigationpanel/comparepanel/DriftsSummary.js +4 -5
- package/dist/navigationpanel/controls/DetailsControls.js +7 -8
- package/dist/navigationpanel/dropdown/ProjectsMenu.js +1 -1
- package/dist/navigationpanel/editorpanel/styles.js +8 -8
- package/dist/navigationpanel/hooks.d.ts +20 -5
- package/dist/navigationpanel/hooks.js +4 -18
- package/dist/navigationpanel/styles.css.d.ts +1 -1
- package/dist/navigationpanel/walkthrough/ActiveWalkthroughControls.js +2 -2
- package/dist/navigationpanel/walkthrough/DynamicViewControls.d.ts +4 -4
- package/dist/navigationpanel/walkthrough/DynamicViewControls.js +23 -25
- package/dist/navigationpanel/walkthrough/WalkthroughPanel.js +5 -5
- package/dist/overlays/Overlays.d.ts +4 -2
- package/dist/overlays/Overlays.js +10 -10
- package/dist/overlays/element-details/ElementDetailsCard.css.js +17 -17
- package/dist/overlays/element-details/MetadataValue.js +15 -15
- package/dist/overlays/element-details/TabPanelDeployments.css.js +5 -5
- package/dist/overlays/element-details/TabPanelRelationships.css.js +11 -11
- package/dist/overlays/element-details/TabPanelRelationships.js +1 -1
- package/dist/overlays/element-details/TabPanelStructure.css.js +2 -2
- package/dist/overlays/element-details/TabPanelStructure.js +1 -1
- package/dist/overlays/element-details/actor.d.ts +2 -3
- package/dist/overlays/hooks.d.ts +28 -0
- package/dist/overlays/hooks.js +5 -0
- package/dist/overlays/overlay/Overlay.js +34 -25
- package/dist/overlays/overlaysActor.js +0 -1
- package/dist/overlays/relationship-details/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationship-details/layout.js +1 -1
- package/dist/overlays/relationships-browser/SelectElement.css.js +2 -2
- package/dist/overlays/relationships-browser/actor.js +79 -78
- package/dist/overlays/relationships-browser/custom/nodeTypes.js +1 -1
- package/dist/overlays/relationships-browser/hooks.js +1 -1
- package/dist/overlays/relationships-browser/layout.js +2 -2
- package/dist/projects-overview/actor.js +4 -4
- package/dist/search/Search.js +1 -1
- package/dist/search/components/ElementsColumn.css.js +2 -2
- package/dist/search/components/ViewsColum.js +1 -1
- package/dist/search/components/_shared.css.d.ts +1 -1
- package/dist/search/components/_shared.css.js +23 -23
- package/dist/search/components/styles.css.js +4 -4
- package/dist/shadowroot/ShadowRoot.d.ts +1 -1
- package/dist/shadowroot/ShadowRoot.js +76 -28
- package/dist/styles2.js +1 -1
- package/dist/utils/defineActors.d.ts +21 -0
- package/dist/utils/defineActors.js +13 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +5 -4
- package/dist/utils/readableText.d.ts +11 -0
- package/dist/utils/readableText.js +18 -0
- package/package.json +18 -30
- package/panda.buildinfo.json +270 -288
- package/styles-min.css +1 -1
- package/styles.css +1 -1
- package/adhoc-editor/package.json +0 -4
- package/dist/adhoc-editor/EditorPanel.d.ts +0 -1
- package/dist/adhoc-editor/EditorPanel.js +0 -106
- package/dist/adhoc-editor/ElementsTree.d.ts +0 -2
- package/dist/adhoc-editor/ElementsTree.js +0 -112
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.d.ts +0 -4
- package/dist/adhoc-editor/LikeC4AdHocViewEditor.js +0 -83
- package/dist/adhoc-editor/components/Tree.d.ts +0 -48
- package/dist/adhoc-editor/components/Tree.js +0 -213
- package/dist/adhoc-editor/hooks.d.ts +0 -14
- package/dist/adhoc-editor/hooks.js +0 -34
- package/dist/adhoc-editor/index.d.ts +0 -2
- package/dist/adhoc-editor/index.js +0 -2
- package/dist/adhoc-editor/state/ActorProvider.d.ts +0 -5
- package/dist/adhoc-editor/state/ActorProvider.js +0 -37
- package/dist/adhoc-editor/state/actor.d.ts +0 -13
- package/dist/adhoc-editor/state/actor.editor.d.ts +0 -56
- package/dist/adhoc-editor/state/actor.editor.js +0 -167
- package/dist/adhoc-editor/state/actor.js +0 -14
- package/dist/adhoc-editor/state/actor.layouter.d.ts +0 -51
- package/dist/adhoc-editor/state/actor.layouter.js +0 -54
- package/dist/adhoc-editor/state/actor.types.d.ts +0 -63
- package/dist/adhoc-editor/state/actor.types.js +0 -25
- package/dist/adhoc-editor/state/panel.d.ts +0 -95
- package/dist/adhoc-editor/state/panel.js +0 -124
- package/dist/adhoc-editor/state/utils.d.ts +0 -17
- package/dist/adhoc-editor/state/utils.js +0 -25
- package/dist/adhoc-editor/useElementsTree.d.ts +0 -18
- package/dist/adhoc-editor/useElementsTree.js +0 -98
- package/dist/adhoc-editor/viewrules/ViewRulesPanel.d.ts +0 -6
- package/dist/context/ShadowRootContext.d.ts +0 -3
- package/dist/context/ShadowRootContext.js +0 -5
- package/dist/shadowroot/styles.d.ts +0 -13
- package/dist/shadowroot/styles.js +0 -60
|
@@ -47,7 +47,7 @@ var container = css({
|
|
|
47
47
|
_smallZoom: { display: "none" },
|
|
48
48
|
_print: { display: "none" }
|
|
49
49
|
});
|
|
50
|
-
function ElementDetailsButton({ selected = false, data: { hovered: isHovered = false }, icon, onClick }) {
|
|
50
|
+
function ElementDetailsButton({ selected = false, data: { hovered: isHovered = false }, icon, ariaLabel = "Open details", onClick }) {
|
|
51
51
|
let variant;
|
|
52
52
|
switch (true) {
|
|
53
53
|
case isHovered:
|
|
@@ -58,6 +58,7 @@ function ElementDetailsButton({ selected = false, data: { hovered: isHovered = f
|
|
|
58
58
|
break;
|
|
59
59
|
default: variant = "normal";
|
|
60
60
|
}
|
|
61
|
+
const isActionVisible = isHovered || selected;
|
|
61
62
|
return /* @__PURE__ */ jsx(Box$1, {
|
|
62
63
|
className: cx(container, "details-button"),
|
|
63
64
|
children: /* @__PURE__ */ jsx(ActionIcon, {
|
|
@@ -70,7 +71,9 @@ function ElementDetailsButton({ selected = false, data: { hovered: isHovered = f
|
|
|
70
71
|
whileTap: "whileTap",
|
|
71
72
|
onClick,
|
|
72
73
|
onDoubleClick: stopPropagation,
|
|
73
|
-
tabIndex: -1,
|
|
74
|
+
tabIndex: isActionVisible ? 0 : -1,
|
|
75
|
+
inert: isActionVisible ? void 0 : true,
|
|
76
|
+
"aria-label": ariaLabel,
|
|
74
77
|
children: icon ?? /* @__PURE__ */ jsx(IconId, {
|
|
75
78
|
stroke: 1.8,
|
|
76
79
|
style: { width: "75%" }
|
|
@@ -2,8 +2,8 @@ import "../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { cx } from "@likec4/styles/css";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import * as m from "motion/react-m";
|
|
6
5
|
import { ensureSizes } from "@likec4/core/types";
|
|
6
|
+
import * as m from "motion/react-m";
|
|
7
7
|
import { elementNode } from "@likec4/styles/recipes";
|
|
8
8
|
//#region src/base-primitives/element/ElementNodeContainer.tsx
|
|
9
9
|
var variants = {
|
|
@@ -324,6 +324,7 @@ function ElementShape({ data, width, height, showSelectionOutline = true }) {
|
|
|
324
324
|
const borderStyle = data.style?.border ?? "none";
|
|
325
325
|
const withBorder = borderStyle !== "none";
|
|
326
326
|
if (data.shape === "rectangle") return /* @__PURE__ */ jsxs("div", {
|
|
327
|
+
"aria-hidden": true,
|
|
327
328
|
style: { borderStyle },
|
|
328
329
|
className: elementShapeRecipe({
|
|
329
330
|
shapetype: "html",
|
|
@@ -337,6 +338,7 @@ function ElementShape({ data, width, height, showSelectionOutline = true }) {
|
|
|
337
338
|
withOutline: showSelectionOutline
|
|
338
339
|
});
|
|
339
340
|
return /* @__PURE__ */ jsxs(Fragment, { children: [isMultiple && /* @__PURE__ */ jsx("svg", {
|
|
341
|
+
"aria-hidden": true,
|
|
340
342
|
className,
|
|
341
343
|
"data-likec4-shape-multiple": "true",
|
|
342
344
|
viewBox: `0 0 ${w} ${h}`,
|
|
@@ -347,6 +349,7 @@ function ElementShape({ data, width, height, showSelectionOutline = true }) {
|
|
|
347
349
|
h
|
|
348
350
|
})
|
|
349
351
|
}), /* @__PURE__ */ jsxs("svg", {
|
|
352
|
+
"aria-hidden": true,
|
|
350
353
|
className,
|
|
351
354
|
viewBox: `0 0 ${w} ${h}`,
|
|
352
355
|
children: [/* @__PURE__ */ jsx(ShapeSvgOutline, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __name } from "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { css } from "@likec4/styles/css";
|
|
3
3
|
import { IconX } from "@tabler/icons-react";
|
|
4
|
-
import {
|
|
4
|
+
import { useRef } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Button, ScrollAreaAutosize, Text, ThemeIcon } from "@mantine/core";
|
|
7
7
|
import { HStack, VStack } from "@likec4/styles/jsx";
|
|
@@ -10,10 +10,8 @@ import { ErrorBoundary } from "react-error-boundary";
|
|
|
10
10
|
function ErrorFallback({ error, resetErrorBoundary }) {
|
|
11
11
|
const errorString = error instanceof Error ? error.message : "Unknown error";
|
|
12
12
|
const dialogRef = useRef(null);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
dialogRef.current?.showModal();
|
|
15
|
-
}, []);
|
|
16
13
|
return /* @__PURE__ */ jsx("dialog", {
|
|
14
|
+
open: true,
|
|
17
15
|
ref: dialogRef,
|
|
18
16
|
className: css({
|
|
19
17
|
margin: "0",
|
|
@@ -111,4 +109,4 @@ function ErrorBoundary$1(props) {
|
|
|
111
109
|
}
|
|
112
110
|
__name(ErrorBoundary$1, "ErrorBoundary");
|
|
113
111
|
//#endregion
|
|
114
|
-
export { ErrorBoundary$1 as ErrorBoundary };
|
|
112
|
+
export { ErrorBoundary$1 as ErrorBoundary, ErrorFallback };
|
package/dist/components/Link.js
CHANGED
|
@@ -3,7 +3,7 @@ import { GithubIcon } from "./GithubIcon.js";
|
|
|
3
3
|
import { css, cx } from "@likec4/styles/css";
|
|
4
4
|
import { IconCheck, IconCopy } from "@tabler/icons-react";
|
|
5
5
|
import { forwardRef } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { ActionIcon, Badge, CopyButton } from "@mantine/core";
|
|
8
8
|
import { styled } from "@likec4/styles/jsx";
|
|
9
9
|
//#region src/components/Link.tsx
|
|
@@ -17,7 +17,7 @@ var Link = forwardRef(({ value, className, ...props }, ref) => {
|
|
|
17
17
|
radius: "sm",
|
|
18
18
|
size: "sm",
|
|
19
19
|
tt: "none",
|
|
20
|
-
leftSection:
|
|
20
|
+
leftSection: null,
|
|
21
21
|
rightSection: /* @__PURE__ */ jsx(CopyButton, {
|
|
22
22
|
value: url,
|
|
23
23
|
timeout: 1500,
|
|
@@ -52,8 +52,8 @@ var Link = forwardRef(({ value, className, ...props }, ref) => {
|
|
|
52
52
|
backgroundColor: {
|
|
53
53
|
base: "transparent",
|
|
54
54
|
_hover: {
|
|
55
|
-
base: "mantine.
|
|
56
|
-
_dark: "mantine.
|
|
55
|
+
base: "mantine.gray[1]",
|
|
56
|
+
_dark: "mantine.dark[5]"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}),
|
|
@@ -85,14 +85,14 @@ var Link = forwardRef(({ value, className, ...props }, ref) => {
|
|
|
85
85
|
_hover: "underline"
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
|
-
children: [isGithub && /* @__PURE__ */ jsx(GithubIcon, {
|
|
88
|
+
children: [!value.title && isGithub && /* @__PURE__ */ jsx(GithubIcon, {
|
|
89
89
|
height: "12",
|
|
90
90
|
width: "12",
|
|
91
91
|
style: {
|
|
92
92
|
verticalAlign: "middle",
|
|
93
93
|
marginRight: "4px"
|
|
94
94
|
}
|
|
95
|
-
}), isGithub ? url.replace(GITHUB_PREFIX, "") : url]
|
|
95
|
+
}), value.title ?? (isGithub ? url.replace(GITHUB_PREFIX, "") : url)]
|
|
96
96
|
})
|
|
97
97
|
});
|
|
98
98
|
});
|
|
@@ -21,7 +21,7 @@ var LogoButton = forwardRef(({ className, ...props }, ref) => {
|
|
|
21
21
|
var NavigationPanel = {
|
|
22
22
|
Root: withProvider(m$1.div, "root", { shouldForwardProp }),
|
|
23
23
|
Body: withContext(m$1.div, "body", { shouldForwardProp }),
|
|
24
|
-
Logo: withContext(LogoButton, "logo"),
|
|
24
|
+
Logo: withContext(LogoButton, "logo", { shouldForwardProp }),
|
|
25
25
|
Label: withContext(m$1.div, "label", { shouldForwardProp }),
|
|
26
26
|
Dropdown: withContext(m$1.div, "dropdown", { shouldForwardProp })
|
|
27
27
|
};
|
|
@@ -8,15 +8,15 @@ var root = css({
|
|
|
8
8
|
border: "1px solid",
|
|
9
9
|
borderColor: {
|
|
10
10
|
base: "default.border",
|
|
11
|
-
_light: "mantine.
|
|
12
|
-
_dark: "mantine.
|
|
11
|
+
_light: "mantine.gray[4]",
|
|
12
|
+
_dark: "mantine.dark[4]",
|
|
13
13
|
_hover: "default.border"
|
|
14
14
|
},
|
|
15
15
|
cursor: "pointer",
|
|
16
16
|
background: {
|
|
17
17
|
base: "default",
|
|
18
18
|
_light: "white",
|
|
19
|
-
_dark: "mantine.
|
|
19
|
+
_dark: "mantine.dark[6]",
|
|
20
20
|
_hover: "default.hover"
|
|
21
21
|
},
|
|
22
22
|
width: "100%",
|
|
@@ -49,19 +49,19 @@ var shortcut = css({
|
|
|
49
49
|
border: "1px solid",
|
|
50
50
|
transition: "fast",
|
|
51
51
|
_light: {
|
|
52
|
-
color: "mantine.
|
|
53
|
-
borderColor: "mantine.
|
|
52
|
+
color: "mantine.gray[7]",
|
|
53
|
+
borderColor: "mantine.gray[2]"
|
|
54
54
|
},
|
|
55
55
|
_dark: {
|
|
56
|
-
color: "mantine.
|
|
57
|
-
borderColor: "mantine.
|
|
56
|
+
color: "mantine.dark[0]",
|
|
57
|
+
borderColor: "mantine.dark[7]"
|
|
58
58
|
},
|
|
59
59
|
backgroundColor: {
|
|
60
|
-
_light: "mantine.
|
|
61
|
-
_dark: "mantine.
|
|
60
|
+
_light: "mantine.gray[2]/70",
|
|
61
|
+
_dark: "mantine.dark[8]/70",
|
|
62
62
|
_groupHover: {
|
|
63
|
-
_light: "mantine.
|
|
64
|
-
_dark: "mantine.
|
|
63
|
+
_light: "mantine.gray[2]",
|
|
64
|
+
_dark: "mantine.dark[8]"
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TagSpecification } from '@likec4/core';
|
|
2
2
|
import { PropsWithChildren } from 'react';
|
|
3
|
-
export declare
|
|
4
|
-
export declare function TagStylesProvider({ children,
|
|
5
|
-
|
|
3
|
+
export declare function generateColorVars(spec: TagSpecification): string;
|
|
4
|
+
export declare function TagStylesProvider({ children, id }: PropsWithChildren<{
|
|
5
|
+
id: string;
|
|
6
6
|
}>): import("react").JSX.Element;
|
|
7
7
|
export declare function useTagSpecifications(): Record<string, TagSpecification>;
|
|
8
8
|
export declare function useTagSpecification(tag: string): TagSpecification;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import "../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { useLikeC4Specification } from "../hooks/useLikeC4Model.js";
|
|
3
3
|
import { createContext, memo } from "react";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { entries, flatMap, isEmpty, join, pipe } from "remeda";
|
|
6
6
|
import { isTagColorSpecified } from "@likec4/core";
|
|
7
7
|
import { useMantineStyleNonce } from "@mantine/core";
|
|
8
8
|
import { DefaultTagColors, getContrastedColorsAPCA, isValidColor } from "@likec4/core/styles";
|
|
9
9
|
//#region src/context/TagStylesContext.tsx
|
|
10
|
-
var TagStylesContext = createContext({});
|
|
11
10
|
var radixColors = DefaultTagColors;
|
|
12
|
-
|
|
11
|
+
function generateColorVars(spec) {
|
|
13
12
|
const color = spec.color;
|
|
14
13
|
if (isTagColorSpecified(spec) && isValidColor(color)) return `
|
|
15
14
|
--colors-likec4-tag-bg: ${color};
|
|
@@ -17,21 +16,22 @@ var generateColorVars = (spec) => {
|
|
|
17
16
|
--colors-likec4-tag-text: ${getContrastedColorsAPCA(color).hiContrast};
|
|
18
17
|
`;
|
|
19
18
|
if (!radixColors.includes(color)) return "";
|
|
20
|
-
let textcolor =
|
|
19
|
+
let textcolor = `var(--colors-${color}-12)`;
|
|
21
20
|
if ([
|
|
22
21
|
"mint",
|
|
23
22
|
"grass",
|
|
24
23
|
"lime",
|
|
25
24
|
"yellow",
|
|
26
25
|
"amber"
|
|
27
|
-
].includes(color)) textcolor = "
|
|
26
|
+
].includes(color)) textcolor = "rgba(0 0 0 / 0.85)";
|
|
28
27
|
return `
|
|
29
28
|
--colors-likec4-tag-border: var(--colors-${color}-8);
|
|
30
29
|
--colors-likec4-tag-bg: var(--colors-${color}-9);
|
|
31
30
|
--colors-likec4-tag-bg-hover: var(--colors-${color}-10);
|
|
32
|
-
--colors-likec4-tag-text:
|
|
31
|
+
--colors-likec4-tag-text: ${textcolor};
|
|
33
32
|
`;
|
|
34
|
-
}
|
|
33
|
+
}
|
|
34
|
+
var TagStylesContext = createContext({});
|
|
35
35
|
function generateStylesheet(tags, rootSelector) {
|
|
36
36
|
if (!tags || isEmpty(tags)) return "";
|
|
37
37
|
return pipe(entries(tags), flatMap(([tag, spec]) => [
|
|
@@ -40,17 +40,17 @@ function generateStylesheet(tags, rootSelector) {
|
|
|
40
40
|
"}"
|
|
41
41
|
]), join("\n"));
|
|
42
42
|
}
|
|
43
|
-
function TagStylesProvider({ children,
|
|
43
|
+
function TagStylesProvider({ children, id }) {
|
|
44
44
|
const tags = useLikeC4Specification().tags;
|
|
45
45
|
const nonce = useMantineStyleNonce()?.();
|
|
46
|
-
const stylesheet = generateStylesheet(tags,
|
|
47
|
-
return /* @__PURE__ */ jsxs(
|
|
46
|
+
const stylesheet = generateStylesheet(tags, `#${id}`);
|
|
47
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [stylesheet !== "" && /* @__PURE__ */ jsx(TagStylesheet, {
|
|
48
|
+
nonce,
|
|
49
|
+
stylesheet
|
|
50
|
+
}), /* @__PURE__ */ jsx(TagStylesContext.Provider, {
|
|
48
51
|
value: tags,
|
|
49
|
-
children
|
|
50
|
-
|
|
51
|
-
stylesheet
|
|
52
|
-
}), children]
|
|
53
|
-
});
|
|
52
|
+
children
|
|
53
|
+
})] });
|
|
54
54
|
}
|
|
55
55
|
var TagStylesheet = memo(({ stylesheet, nonce }) => {
|
|
56
56
|
return /* @__PURE__ */ jsx("style", {
|
|
@@ -61,4 +61,4 @@ var TagStylesheet = memo(({ stylesheet, nonce }) => {
|
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
63
|
//#endregion
|
|
64
|
-
export { TagStylesProvider };
|
|
64
|
+
export { TagStylesProvider, generateColorVars };
|
package/dist/custom/index.d.ts
CHANGED
|
@@ -13,3 +13,4 @@ export type { OverlayProps } from '../overlays/overlay/Overlay';
|
|
|
13
13
|
export { PortalToContainer } from '../components/PortalToContainer';
|
|
14
14
|
export { FramerMotionConfig } from '../context/FramerMotionConfig';
|
|
15
15
|
export { NavigationPanel } from '../components/NavigationPanel';
|
|
16
|
+
export { ErrorBoundary, ErrorFallback } from '../components/ErrorFallback';
|
package/dist/custom/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { useDiagramContext, useOnDiagramEvent } from "../hooks/useDiagram.js";
|
|
|
9
9
|
import { useCurrentView, useCurrentViewId } from "../hooks/useCurrentView.js";
|
|
10
10
|
import { useOptionalCurrentViewModel, useOptionalLikeC4Model } from "../context/LikeC4ModelContext.js";
|
|
11
11
|
import { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel } from "../hooks/useLikeC4Model.js";
|
|
12
|
+
import { ErrorBoundary, ErrorFallback } from "../components/ErrorFallback.js";
|
|
12
13
|
import { useCurrentViewModel } from "../hooks/useCurrentViewModel.js";
|
|
13
14
|
import { useHasProjects, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext } from "../hooks/useLikeC4Project.js";
|
|
14
15
|
import { useLikeC4Styles } from "../hooks/useLikeC4Styles.js";
|
|
@@ -35,6 +36,6 @@ import { CompoundDeploymentToolbar, CompoundElementToolbar } from "../likec4diag
|
|
|
35
36
|
import { DeploymentElementToolbar, ElementToolbar } from "../likec4diagram/custom/nodes/toolbar/ElementToolbar.js";
|
|
36
37
|
import { CompoundDeploymentNode, CompoundDetailsButtonWithHandler, CompoundElementNode, DeploymentNode, ElementDetailsButtonWithHandler, ElementNode, ViewGroupNode } from "../likec4diagram/custom/nodes/nodes.js";
|
|
37
38
|
import { SequenceActorNode, SequenceParallelArea } from "../likec4diagram/custom/nodes/SequenceActorNode.js";
|
|
38
|
-
import { NavigationPanel } from "../components/NavigationPanel.js";
|
|
39
39
|
import { compoundDeploymentNode, compoundElementNode, deploymentNode, elementNode, sequenceActorNode, viewGroupNode } from "./customNodes.js";
|
|
40
|
-
|
|
40
|
+
import { NavigationPanel } from "../components/NavigationPanel.js";
|
|
41
|
+
export { Base, CompoundActionButton, CompoundActions, CompoundDeploymentNode, CompoundDeploymentToolbar, CompoundDetailsButton, CompoundDetailsButtonWithHandler, CompoundElementNode, CompoundElementToolbar, CompoundNodeContainer, CompoundTitle, DefaultHandles, DeploymentElementActions, DeploymentElementToolbar, DeploymentNode, ElementActionButtons, ElementActions, ElementData, ElementDetailsButton, ElementDetailsButtonWithHandler, ElementNode, ElementNodeContainer, ElementShape, ElementTag, ElementTags, ElementToolbar, ErrorBoundary, ErrorFallback, FramerMotionConfig, IfEnabled, IfNotEnabled, IfNotReadOnly, IfReadOnly, Markdown, NavigationPanel, Overlay, PortalToContainer, SequenceActorNode, SequenceParallelArea, Toolbar, ViewGroupNode, compoundDeploymentNode, compoundElementNode, deploymentNode, elementNode, memoEdge, memoNode, sequenceActorNode, useCurrentView, useCurrentViewId, useCurrentViewModel, useDiagram, useDiagramActorRef, useDiagramContext, useDiagramEventHandlers, useEnabledFeatures, useHasProjects, useLikeC4Model, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext, useLikeC4Specification, useLikeC4Styles, useLikeC4ViewModel, useOnDiagramEvent, useOptionalCurrentViewModel, useOptionalLikeC4Model, useSetState, useUpdateEffect, viewGroupNode };
|
|
@@ -185,4 +185,4 @@ var clearQueue = () => machine.assign({
|
|
|
185
185
|
processing: null
|
|
186
186
|
});
|
|
187
187
|
//#endregion
|
|
188
|
-
export { cancelSync, clearQueue, deleteNodesAndEdges, makeSnapshot, pushHistory, pushToSyncQueue, redo, saveBeforeEditing, scheduleSync, undo };
|
|
188
|
+
export { cancelSync, clearQueue, deleteNodesAndEdges, isLayoutChange, isLayoutChangeOp, makeSnapshot, pushHistory, pushToSyncQueue, redo, saveBeforeEditing, scheduleSync, undo };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { ActorRef, SnapshotFrom
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
syncQueue: 'idle' | 'pending' | 'suspended' | 'process';
|
|
6
|
-
}, EditorActorStateTag, EditorActorInput, any, EditorActorEmitedEvent, any, any> {
|
|
1
|
+
import { ActorRef, SnapshotFrom } from 'xstate';
|
|
2
|
+
import { BaseEditorActorLogic } from './setup';
|
|
3
|
+
import { EditorActorEmitedEvent, EditorActorEvent } from './types';
|
|
4
|
+
export interface EditorActorLogic extends BaseEditorActorLogic {
|
|
7
5
|
}
|
|
8
6
|
export declare const editorActorLogic: EditorActorLogic;
|
|
9
7
|
export type EditorActorSnapshot = SnapshotFrom<EditorActorLogic>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { ActorRefFromLogic, StateMachine, StateValue, PromiseActorLogic, EventObject, SetupReturn, NonReducibleUnknown, MetaObject } from 'xstate';
|
|
2
|
+
import { inferChildrenRef, inferProvidedActor } from '../../utils/defineActors';
|
|
1
3
|
import { EditorActorContext, EditorActorEmitedEvent, EditorActorEvent, EditorActorInput, EditorActorStateTag } from './types';
|
|
2
|
-
import { SetupReturn, PromiseActorLogic, EventObject, NonReducibleUnknown, MetaObject } from 'xstate';
|
|
3
4
|
import { HotkeyActorLogic } from './hotkey';
|
|
4
5
|
import type * as t from '@likec4/core/types';
|
|
5
6
|
export declare namespace EditorCalls {
|
|
@@ -41,11 +42,17 @@ export declare namespace EditorCalls {
|
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
+
declare const actors: {
|
|
46
|
+
hotkey: HotkeyActorLogic;
|
|
45
47
|
applyLatest: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
46
48
|
executeChange: PromiseActorLogic<EditorCalls.ExecuteChange.Output, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
47
49
|
applySemanticLayout: PromiseActorLogic<EditorCalls.ApplySemanticLayout.Output, EditorCalls.ApplySemanticLayout.Input, EventObject>;
|
|
50
|
+
};
|
|
51
|
+
export declare const machine: SetupReturn<EditorActorContext, EditorActorEvent, {
|
|
48
52
|
hotkey: HotkeyActorLogic;
|
|
53
|
+
applyLatest: PromiseActorLogic<EditorCalls.ApplyLatestToManual.Output, EditorCalls.ApplyLatestToManual.Input, EventObject>;
|
|
54
|
+
executeChange: PromiseActorLogic<EditorCalls.ExecuteChange.Output, EditorCalls.ExecuteChange.Input, EventObject>;
|
|
55
|
+
applySemanticLayout: PromiseActorLogic<EditorCalls.ApplySemanticLayout.Output, EditorCalls.ApplySemanticLayout.Input, EventObject>;
|
|
49
56
|
}, {
|
|
50
57
|
hotkey: "hotkey";
|
|
51
58
|
}, {}, {
|
|
@@ -53,3 +60,10 @@ export declare const machine: SetupReturn<EditorActorContext, EditorActorEvent,
|
|
|
53
60
|
'can undo': unknown;
|
|
54
61
|
'can redo': unknown;
|
|
55
62
|
}, "500ms" | "wait-after-edit", EditorActorStateTag, EditorActorInput, NonReducibleUnknown, EditorActorEmitedEvent, MetaObject>;
|
|
63
|
+
/**
|
|
64
|
+
* to workaround circular dependency issue between editor and diagram packages
|
|
65
|
+
*/
|
|
66
|
+
export interface BaseEditorActorLogic<State extends StateValue = any> extends StateMachine<EditorActorContext, EditorActorEvent, inferChildrenRef<typeof actors>, inferProvidedActor<typeof actors>, never, never, never, State, EditorActorStateTag, EditorActorInput, never, EditorActorEmitedEvent, never, never> {
|
|
67
|
+
}
|
|
68
|
+
export type BaseEditorActorRef = ActorRefFromLogic<BaseEditorActorLogic>;
|
|
69
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { defineActors } from "../../utils/defineActors.js";
|
|
2
3
|
import { hotkey } from "./hotkey.js";
|
|
3
4
|
import { fromPromise, setup } from "xstate";
|
|
4
5
|
var machine = setup({
|
|
@@ -10,7 +11,8 @@ var machine = setup({
|
|
|
10
11
|
children: {},
|
|
11
12
|
tags: ""
|
|
12
13
|
},
|
|
13
|
-
actors: {
|
|
14
|
+
actors: defineActors({
|
|
15
|
+
hotkey,
|
|
14
16
|
applyLatest: fromPromise(() => {
|
|
15
17
|
throw new Error("Not implemented");
|
|
16
18
|
}),
|
|
@@ -19,9 +21,8 @@ var machine = setup({
|
|
|
19
21
|
}),
|
|
20
22
|
applySemanticLayout: fromPromise(() => {
|
|
21
23
|
throw new Error("Not implemented");
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
},
|
|
24
|
+
})
|
|
25
|
+
}),
|
|
25
26
|
delays: {
|
|
26
27
|
"500ms": 500,
|
|
27
28
|
"wait-after-edit": 1e3
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export { useCurrentViewModel } from './useCurrentViewModel';
|
|
|
11
11
|
export { useLikeC4Model, useLikeC4Specification, useLikeC4ViewModel, useOptionalLikeC4Model, } from './useLikeC4Model';
|
|
12
12
|
export { useChangeLikeC4Project, useHasProjects, useLikeC4Project, useLikeC4ProjectId, useLikeC4Projects, useLikeC4ProjectsContext, } from './useLikeC4Project';
|
|
13
13
|
export { useLikeC4Styles } from './useLikeC4Styles';
|
|
14
|
-
export
|
|
14
|
+
export { selectDiagramContext, selectDiagramSnapshot, useDiagram, useDiagramSelector, useOnDiagramEvent, } from './useDiagram';
|
|
@@ -1,7 +1,160 @@
|
|
|
1
1
|
import { Provider } from 'react';
|
|
2
|
+
import { AnyActorRef, SnapshotFrom, MachineSnapshot, ActorRefFromLogic } from 'xstate';
|
|
2
3
|
import { DiagramApi } from '../likec4diagram/state/diagram-api';
|
|
3
|
-
import { DiagramActorRef } from '../likec4diagram/state/types';
|
|
4
|
-
|
|
4
|
+
import { DiagramActorRef, DiagramContext } from '../likec4diagram/state/types';
|
|
5
|
+
import { DiagramEvents } from '../custom';
|
|
6
|
+
import { OverlaysActorRef, OverlaysActorLogic } from '../overlays/overlaysActor';
|
|
7
|
+
import { SearchActorRef, SearchActorLogic } from '../search/searchActor';
|
|
8
|
+
import { BaseEditorActorRef } from '../editor/actor/setup';
|
|
9
|
+
import { NavigationPanelActorRef, NavigationPanelActorLogic } from '../navigationpanel/actor';
|
|
10
|
+
import { HotkeyActorLogic } from '../likec4diagram/state/hotkeyActor';
|
|
11
|
+
import { MediaPrintActorLogic } from '../likec4diagram/state/mediaPrintActor';
|
|
12
|
+
import { EditorActorLogic } from '../editor';
|
|
5
13
|
export declare const DiagramApiContextProvider: Provider<DiagramApi>;
|
|
6
|
-
export declare function useDiagramActorRef(): DiagramActorRef;
|
|
7
14
|
export declare function useDiagram(): DiagramApi;
|
|
15
|
+
/**
|
|
16
|
+
* Tuple type for selector and compare function pair
|
|
17
|
+
*/
|
|
18
|
+
type SelectAndCompare<A, B> = [
|
|
19
|
+
selector: (snapshot: A) => B,
|
|
20
|
+
compare: (a: B, b: B) => boolean
|
|
21
|
+
];
|
|
22
|
+
type SafeContextForActor<A extends AnyActorRef, Snapshot, Context> = {
|
|
23
|
+
/**
|
|
24
|
+
* The React context provider for this actor
|
|
25
|
+
*/
|
|
26
|
+
ContextProvider: Provider<A>;
|
|
27
|
+
/**
|
|
28
|
+
* Hook to get the actor ref from context
|
|
29
|
+
*/
|
|
30
|
+
useActorRef: () => A;
|
|
31
|
+
/**
|
|
32
|
+
* @param select - Function to extract a value from the actor's snapshot
|
|
33
|
+
* @param compare - Optional comparison function. If not provided, shallow equality is used.
|
|
34
|
+
* The comparison function receives the selected value from the previous snapshot ()
|
|
35
|
+
* and the selected value from the current snapshot. If the comparison returns true,
|
|
36
|
+
* the component will not re-render.
|
|
37
|
+
*/
|
|
38
|
+
selectSnapshot<T>(select: (state: Snapshot) => T, compare?: (old: NoInfer<T>, next: NoInfer<T>) => boolean): SelectAndCompare<Snapshot, T>;
|
|
39
|
+
/**
|
|
40
|
+
* @param select - Function to extract a value from the actor's context
|
|
41
|
+
* @param compare - Optional comparison function. If not provided, shallow equality is used.
|
|
42
|
+
*/
|
|
43
|
+
selectContext<T>(select: (state: Context) => T, compare?: (old: NoInfer<T>, next: NoInfer<T>) => boolean): SelectAndCompare<Snapshot, T>;
|
|
44
|
+
useActorSelector<T>(select: (state: Snapshot) => T): T;
|
|
45
|
+
useActorSelector<T>(selectorCompare: SelectAndCompare<Snapshot, T>): T;
|
|
46
|
+
useActorSelector<T>(...selectorCompare: SelectAndCompare<Snapshot, T>): T;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Helper to create a safe context for an actor
|
|
50
|
+
* @example
|
|
51
|
+
* ```tsx
|
|
52
|
+
* const {
|
|
53
|
+
* ContextProvider: MyActorContext,
|
|
54
|
+
* useActorRef,
|
|
55
|
+
* selectSnapshot,
|
|
56
|
+
* useActorSelector
|
|
57
|
+
* } = createSafeContextForActor<MyActorRef>()
|
|
58
|
+
*
|
|
59
|
+
* const select = selectSnapshot(
|
|
60
|
+
* s => ....,
|
|
61
|
+
* (a, b) => a === b
|
|
62
|
+
* )
|
|
63
|
+
*
|
|
64
|
+
* // Later in component:
|
|
65
|
+
* const value = useActorSelector(select)
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare function createSafeContextForActor<A extends AnyActorRef, Snapshot = SnapshotFrom<A>, Context = Snapshot extends {
|
|
69
|
+
context: infer C;
|
|
70
|
+
} ? C : never>(name: string): SafeContextForActor<A, Snapshot, Context>;
|
|
71
|
+
export declare const DiagramActorContextProvider: Provider<DiagramActorRef>, selectDiagramSnapshot: <T>(select: (state: MachineSnapshot<DiagramContext, DiagramEvents, {
|
|
72
|
+
overlays: OverlaysActorRef | undefined;
|
|
73
|
+
search: SearchActorRef | undefined;
|
|
74
|
+
editor: BaseEditorActorRef | undefined;
|
|
75
|
+
navigationPanel: NavigationPanelActorRef | undefined;
|
|
76
|
+
} & Omit<{
|
|
77
|
+
hotkey: ActorRefFromLogic<HotkeyActorLogic> | undefined;
|
|
78
|
+
overlays: ActorRefFromLogic<OverlaysActorLogic> | undefined;
|
|
79
|
+
search: ActorRefFromLogic<SearchActorLogic> | undefined;
|
|
80
|
+
mediaPrint: ActorRefFromLogic<MediaPrintActorLogic> | undefined;
|
|
81
|
+
editor: ActorRefFromLogic<EditorActorLogic> | undefined;
|
|
82
|
+
navigationPanel: ActorRefFromLogic<NavigationPanelActorLogic> | undefined;
|
|
83
|
+
}, "search" | "overlays" | "editor" | "navigationPanel">, "final" | "isReady" | "navigating" | "ready" | "initializing" | {
|
|
84
|
+
ready?: NonNullable<"idle" | "walkthrough" | "focused" | "printing">;
|
|
85
|
+
}, never, never, never, never>) => T, compare?: ((old: NoInfer<T>, next: NoInfer<T>) => boolean) | undefined) => SelectAndCompare< MachineSnapshot<DiagramContext, DiagramEvents, {
|
|
86
|
+
overlays: OverlaysActorRef | undefined;
|
|
87
|
+
search: SearchActorRef | undefined;
|
|
88
|
+
editor: BaseEditorActorRef | undefined;
|
|
89
|
+
navigationPanel: NavigationPanelActorRef | undefined;
|
|
90
|
+
} & Omit<{
|
|
91
|
+
hotkey: ActorRefFromLogic<HotkeyActorLogic> | undefined;
|
|
92
|
+
overlays: ActorRefFromLogic<OverlaysActorLogic> | undefined;
|
|
93
|
+
search: ActorRefFromLogic<SearchActorLogic> | undefined;
|
|
94
|
+
mediaPrint: ActorRefFromLogic<MediaPrintActorLogic> | undefined;
|
|
95
|
+
editor: ActorRefFromLogic<EditorActorLogic> | undefined;
|
|
96
|
+
navigationPanel: ActorRefFromLogic<NavigationPanelActorLogic> | undefined;
|
|
97
|
+
}, "search" | "overlays" | "editor" | "navigationPanel">, "final" | "isReady" | "navigating" | "ready" | "initializing" | {
|
|
98
|
+
ready?: NonNullable<"idle" | "walkthrough" | "focused" | "printing">;
|
|
99
|
+
}, never, never, never, never>, T>, selectDiagramContext: <T>(select: (state: DiagramContext) => T, compare?: ((old: NoInfer<T>, next: NoInfer<T>) => boolean) | undefined) => SelectAndCompare< MachineSnapshot<DiagramContext, DiagramEvents, {
|
|
100
|
+
overlays: OverlaysActorRef | undefined;
|
|
101
|
+
search: SearchActorRef | undefined;
|
|
102
|
+
editor: BaseEditorActorRef | undefined;
|
|
103
|
+
navigationPanel: NavigationPanelActorRef | undefined;
|
|
104
|
+
} & Omit<{
|
|
105
|
+
hotkey: ActorRefFromLogic<HotkeyActorLogic> | undefined;
|
|
106
|
+
overlays: ActorRefFromLogic<OverlaysActorLogic> | undefined;
|
|
107
|
+
search: ActorRefFromLogic<SearchActorLogic> | undefined;
|
|
108
|
+
mediaPrint: ActorRefFromLogic<MediaPrintActorLogic> | undefined;
|
|
109
|
+
editor: ActorRefFromLogic<EditorActorLogic> | undefined;
|
|
110
|
+
navigationPanel: ActorRefFromLogic<NavigationPanelActorLogic> | undefined;
|
|
111
|
+
}, "search" | "overlays" | "editor" | "navigationPanel">, "final" | "isReady" | "navigating" | "ready" | "initializing" | {
|
|
112
|
+
ready?: NonNullable<"idle" | "walkthrough" | "focused" | "printing">;
|
|
113
|
+
}, never, never, never, never>, T>, useDiagramSelector: {
|
|
114
|
+
<T>(select: (state: MachineSnapshot<DiagramContext, DiagramEvents, {
|
|
115
|
+
overlays: OverlaysActorRef | undefined;
|
|
116
|
+
search: SearchActorRef | undefined;
|
|
117
|
+
editor: BaseEditorActorRef | undefined;
|
|
118
|
+
navigationPanel: NavigationPanelActorRef | undefined;
|
|
119
|
+
} & Omit<{
|
|
120
|
+
hotkey: ActorRefFromLogic<HotkeyActorLogic> | undefined;
|
|
121
|
+
overlays: ActorRefFromLogic<OverlaysActorLogic> | undefined;
|
|
122
|
+
search: ActorRefFromLogic<SearchActorLogic> | undefined;
|
|
123
|
+
mediaPrint: ActorRefFromLogic<MediaPrintActorLogic> | undefined;
|
|
124
|
+
editor: ActorRefFromLogic<EditorActorLogic> | undefined;
|
|
125
|
+
navigationPanel: ActorRefFromLogic<NavigationPanelActorLogic> | undefined;
|
|
126
|
+
}, "search" | "overlays" | "editor" | "navigationPanel">, "final" | "isReady" | "navigating" | "ready" | "initializing" | {
|
|
127
|
+
ready?: NonNullable<"idle" | "walkthrough" | "focused" | "printing">;
|
|
128
|
+
}, never, never, never, never>) => T): T;
|
|
129
|
+
<T>(selectorCompare: SelectAndCompare< MachineSnapshot<DiagramContext, DiagramEvents, {
|
|
130
|
+
overlays: OverlaysActorRef | undefined;
|
|
131
|
+
search: SearchActorRef | undefined;
|
|
132
|
+
editor: BaseEditorActorRef | undefined;
|
|
133
|
+
navigationPanel: NavigationPanelActorRef | undefined;
|
|
134
|
+
} & Omit<{
|
|
135
|
+
hotkey: ActorRefFromLogic<HotkeyActorLogic> | undefined;
|
|
136
|
+
overlays: ActorRefFromLogic<OverlaysActorLogic> | undefined;
|
|
137
|
+
search: ActorRefFromLogic<SearchActorLogic> | undefined;
|
|
138
|
+
mediaPrint: ActorRefFromLogic<MediaPrintActorLogic> | undefined;
|
|
139
|
+
editor: ActorRefFromLogic<EditorActorLogic> | undefined;
|
|
140
|
+
navigationPanel: ActorRefFromLogic<NavigationPanelActorLogic> | undefined;
|
|
141
|
+
}, "search" | "overlays" | "editor" | "navigationPanel">, "final" | "isReady" | "navigating" | "ready" | "initializing" | {
|
|
142
|
+
ready?: NonNullable<"idle" | "walkthrough" | "focused" | "printing">;
|
|
143
|
+
}, never, never, never, never>, T>): T;
|
|
144
|
+
<T>(selector: (snapshot: MachineSnapshot<DiagramContext, DiagramEvents, {
|
|
145
|
+
overlays: OverlaysActorRef | undefined;
|
|
146
|
+
search: SearchActorRef | undefined;
|
|
147
|
+
editor: BaseEditorActorRef | undefined;
|
|
148
|
+
navigationPanel: NavigationPanelActorRef | undefined;
|
|
149
|
+
} & Omit<{
|
|
150
|
+
hotkey: ActorRefFromLogic<HotkeyActorLogic> | undefined;
|
|
151
|
+
overlays: ActorRefFromLogic<OverlaysActorLogic> | undefined;
|
|
152
|
+
search: ActorRefFromLogic<SearchActorLogic> | undefined;
|
|
153
|
+
mediaPrint: ActorRefFromLogic<MediaPrintActorLogic> | undefined;
|
|
154
|
+
editor: ActorRefFromLogic<EditorActorLogic> | undefined;
|
|
155
|
+
navigationPanel: ActorRefFromLogic<NavigationPanelActorLogic> | undefined;
|
|
156
|
+
}, "search" | "overlays" | "editor" | "navigationPanel">, "final" | "isReady" | "navigating" | "ready" | "initializing" | {
|
|
157
|
+
ready?: NonNullable<"idle" | "walkthrough" | "focused" | "printing">;
|
|
158
|
+
}, never, never, never, never>) => T, compare: (a: T, b: T) => boolean): T;
|
|
159
|
+
}, useDiagramActorRef: () => DiagramActorRef;
|
|
160
|
+
export {};
|