@x-titan/fetcher 0.0.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/.obsidian/app.json +7 -0
- package/.obsidian/appearance.json +5 -0
- package/.obsidian/community-plugins.json +7 -0
- package/.obsidian/core-plugins.json +33 -0
- package/.obsidian/hotkeys.json +19 -0
- package/.obsidian/icons/boxicons.zip +0 -0
- package/.obsidian/icons/font-awesome-brands.zip +0 -0
- package/.obsidian/icons/font-awesome-regular.zip +0 -0
- package/.obsidian/icons/font-awesome-solid.zip +0 -0
- package/.obsidian/icons/simple-icons.zip +0 -0
- package/.obsidian/plugins/advanced-canvas/main.js +7372 -0
- package/.obsidian/plugins/advanced-canvas/manifest.json +11 -0
- package/.obsidian/plugins/advanced-canvas/styles.css +508 -0
- package/.obsidian/plugins/canvas-mindmap/main.js +8 -0
- package/.obsidian/plugins/canvas-mindmap/manifest.json +15 -0
- package/.obsidian/plugins/canvas-mindmap/styles.css +29 -0
- package/.obsidian/plugins/custom-sidebar-icons/main.js +37831 -0
- package/.obsidian/plugins/custom-sidebar-icons/manifest.json +15 -0
- package/.obsidian/plugins/custom-sidebar-icons/styles.css +1 -0
- package/.obsidian/plugins/iconic/data.json +38 -0
- package/.obsidian/plugins/iconic/main.js +9 -0
- package/.obsidian/plugins/iconic/manifest.json +10 -0
- package/.obsidian/plugins/iconic/styles.css +609 -0
- package/.obsidian/plugins/obsidian-excalidraw-plugin/main.js +10 -0
- package/.obsidian/plugins/obsidian-excalidraw-plugin/manifest.json +12 -0
- package/.obsidian/plugins/obsidian-excalidraw-plugin/styles.css +1 -0
- package/.obsidian/plugins/obsidian-icon-folder/data.json +31 -0
- package/.obsidian/plugins/obsidian-icon-folder/main.js +7158 -0
- package/.obsidian/plugins/obsidian-icon-folder/manifest.json +10 -0
- package/.obsidian/plugins/obsidian-icon-folder/styles.css +120 -0
- package/.obsidian/plugins/obsidian-kanban/main.js +153 -0
- package/.obsidian/plugins/obsidian-kanban/manifest.json +11 -0
- package/.obsidian/plugins/obsidian-kanban/styles.css +1 -0
- package/.obsidian/plugins/table-editor-obsidian/data.json +6 -0
- package/.obsidian/plugins/table-editor-obsidian/main.js +236 -0
- package/.obsidian/plugins/table-editor-obsidian/manifest.json +17 -0
- package/.obsidian/plugins/table-editor-obsidian/styles.css +78 -0
- package/.obsidian/snippets/CustomIcon-AutoGen.css +17 -0
- package/.obsidian/templates.json +3 -0
- package/.obsidian/themes/ASET Simple/.editorconfig +10 -0
- package/.obsidian/themes/ASET Simple/.git1/HEAD +1 -0
- package/.obsidian/themes/ASET Simple/.git1/config +13 -0
- package/.obsidian/themes/ASET Simple/.git1/description +1 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/applypatch-msg.sample +15 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/commit-msg.sample +24 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/fsmonitor-watchman.sample +174 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/post-update.sample +8 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/pre-applypatch.sample +14 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/pre-commit.sample +49 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/pre-merge-commit.sample +13 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/pre-push.sample +53 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/pre-rebase.sample +169 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/pre-receive.sample +24 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/prepare-commit-msg.sample +42 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/push-to-checkout.sample +78 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/sendemail-validate.sample +77 -0
- package/.obsidian/themes/ASET Simple/.git1/hooks/update.sample +128 -0
- package/.obsidian/themes/ASET Simple/.git1/index +0 -0
- package/.obsidian/themes/ASET Simple/.git1/info/exclude +6 -0
- package/.obsidian/themes/ASET Simple/.git1/objects/pack/pack-37b1d733e37d8c14f634edcfb396cffa341c1de9.idx +0 -0
- package/.obsidian/themes/ASET Simple/.git1/objects/pack/pack-37b1d733e37d8c14f634edcfb396cffa341c1de9.pack +0 -0
- package/.obsidian/themes/ASET Simple/.git1/objects/pack/pack-37b1d733e37d8c14f634edcfb396cffa341c1de9.rev +0 -0
- package/.obsidian/themes/ASET Simple/.git1/packed-refs +2 -0
- package/.obsidian/themes/ASET Simple/.git1/refs/heads/master +1 -0
- package/.obsidian/themes/ASET Simple/.git1/refs/remotes/origin/HEAD +1 -0
- package/.obsidian/themes/ASET Simple/.github/workflows/release-version.yml +50 -0
- package/.obsidian/themes/ASET Simple/README.md +95 -0
- package/.obsidian/themes/ASET Simple/manifest.json +7 -0
- package/.obsidian/themes/ASET Simple/package.json +7 -0
- package/.obsidian/themes/ASET Simple/theme.css +164 -0
- package/.obsidian/themes/ASET Simple/version-bump.mjs +26 -0
- package/.obsidian/themes/ASET Simple/versions.json +3 -0
- package/.obsidian/themes/Atom/manifest.json +6 -0
- package/.obsidian/themes/Atom/theme.css +339 -0
- package/.obsidian/themes/Borealis/manifest.json +7 -0
- package/.obsidian/themes/Borealis/theme.css +1164 -0
- package/.obsidian/themes/Cupertino/manifest.json +8 -0
- package/.obsidian/themes/Cupertino/theme.css +107 -0
- package/.obsidian/themes/Flexoki/manifest.json +7 -0
- package/.obsidian/themes/Flexoki/theme.css +82 -0
- package/.obsidian/themes/Focus/manifest.json +7 -0
- package/.obsidian/themes/Focus/theme.css +1047 -0
- package/.obsidian/themes/GitHub Theme/manifest.json +7 -0
- package/.obsidian/themes/GitHub Theme/theme.css +1245 -0
- package/.obsidian/themes/Minimal/manifest.json +8 -0
- package/.obsidian/themes/Minimal/theme.css +2223 -0
- package/.obsidian/themes/Notation/manifest.json +6 -0
- package/.obsidian/themes/Notation/theme.css +831 -0
- package/.obsidian/themes/Notation 2/manifest.json +7 -0
- package/.obsidian/themes/Notation 2/theme.css +1887 -0
- package/.obsidian/themes/Oreo/manifest.json +7 -0
- package/.obsidian/themes/Oreo/theme.css +2242 -0
- package/.obsidian/themes/Pure/manifest.json +6 -0
- package/.obsidian/themes/Pure/theme.css +288 -0
- package/.obsidian/themes/Simple/manifest.json +7 -0
- package/.obsidian/themes/Simple/theme.css +1005 -0
- package/.obsidian/themes/Sodalite/manifest.json +7 -0
- package/.obsidian/themes/Sodalite/theme.css +905 -0
- package/.obsidian/themes/Things/manifest.json +7 -0
- package/.obsidian/themes/Things/theme.css +1628 -0
- package/.obsidian/themes/Vanilla AMOLED/manifest.json +7 -0
- package/.obsidian/themes/Vanilla AMOLED/theme.css +25 -0
- package/.obsidian/themes/Vanilla AMOLED Color/manifest.json +7 -0
- package/.obsidian/themes/Vanilla AMOLED Color/theme.css +49 -0
- package/.obsidian/themes/Wikipedia/manifest.json +7 -0
- package/.obsidian/themes/Wikipedia/theme.css +1134 -0
- package/.obsidian/themes/mono black (monochrome, charcoal)/manifest.json +7 -0
- package/.obsidian/themes/mono black (monochrome, charcoal)/theme.css +17 -0
- package/.obsidian/workspace.json +218 -0
- package/LICENCE +21 -0
- package/dist/fetcher.d.ts +17 -0
- package/dist/fetcher.d.ts.map +1 -0
- package/dist/fetcher.js +54 -0
- package/dist/fetcher.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/responses.d.ts +6 -0
- package/dist/responses.d.ts.map +1 -0
- package/dist/responses.js +23 -0
- package/dist/responses.js.map +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +9 -0
- package/dist/utils.js.map +1 -0
- package/nodemon.json +6 -0
- package/package.json +38 -0
- package/src/fetcher.ts +68 -0
- package/src/index.ts +7 -0
- package/src/responses.ts +19 -0
- package/src/types.ts +15 -0
- package/src/utils.ts +9 -0
- package/tsconfig.json +49 -0
- package/tsup.config.ts +11 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "advanced-canvas",
|
|
3
|
+
"name": "Advanced Canvas",
|
|
4
|
+
"version": "5.6.5",
|
|
5
|
+
"minAppVersion": "1.1.0",
|
|
6
|
+
"description": "Supercharge your canvas experience! Create presentations, flowcharts and more!",
|
|
7
|
+
"author": "Developer-Mike",
|
|
8
|
+
"authorUrl": "https://github.com/Developer-Mike",
|
|
9
|
+
"fundingUrl": "https://ko-fi.com/X8X27IA08",
|
|
10
|
+
"isDesktopOnly": false
|
|
11
|
+
}
|
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
/* src/styles.scss */
|
|
2
|
+
.properties-field > .setting-item-info {
|
|
3
|
+
flex: 0;
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding: var(--size-4-1) var(--size-4-2);
|
|
6
|
+
border: var(--input-border-width) solid var(--background-modifier-border);
|
|
7
|
+
border-radius: var(--input-radius) 0 0 var(--input-radius);
|
|
8
|
+
}
|
|
9
|
+
.properties-field > .setting-item-control > input {
|
|
10
|
+
width: 100%;
|
|
11
|
+
border-radius: 0 var(--input-radius) var(--input-radius) 0;
|
|
12
|
+
}
|
|
13
|
+
.ac-settings-heading {
|
|
14
|
+
border-bottom: 1px solid var(--color-accent);
|
|
15
|
+
}
|
|
16
|
+
.ac-settings-heading:not(:first-child) {
|
|
17
|
+
margin-top: var(--size-4-10) !important;
|
|
18
|
+
}
|
|
19
|
+
.ac-settings-heading:has(.checkbox-container:not(.is-enabled)) {
|
|
20
|
+
border-bottom-color: var(--background-modifier-border-hover);
|
|
21
|
+
}
|
|
22
|
+
.ac-settings-heading .setting-item-description {
|
|
23
|
+
margin-inline-end: 20px;
|
|
24
|
+
}
|
|
25
|
+
.settings-header-children {
|
|
26
|
+
transform-origin: top center;
|
|
27
|
+
transform: scaleY(1);
|
|
28
|
+
transition: transform 0.2s ease-in-out;
|
|
29
|
+
}
|
|
30
|
+
.settings-header-children details {
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
align-items: initial;
|
|
33
|
+
}
|
|
34
|
+
.ac-settings-heading:has(.checkbox-container:not(.is-enabled)) + .settings-header-children {
|
|
35
|
+
opacity: 0.5;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
height: 0;
|
|
38
|
+
transform: scaleY(0);
|
|
39
|
+
}
|
|
40
|
+
details.setting-item[open] > summary {
|
|
41
|
+
margin-bottom: 0.75em;
|
|
42
|
+
}
|
|
43
|
+
details.setting-item > *:not(summary) {
|
|
44
|
+
padding-left: 1em;
|
|
45
|
+
border-left: 1px solid var(--color-accent);
|
|
46
|
+
}
|
|
47
|
+
.kofi-banner {
|
|
48
|
+
position: relative;
|
|
49
|
+
display: flex;
|
|
50
|
+
flex-direction: column;
|
|
51
|
+
padding: var(--size-4-3);
|
|
52
|
+
background-color: var(--background-secondary);
|
|
53
|
+
border: 1px solid var(--divider-color);
|
|
54
|
+
border-radius: var(--radius-s);
|
|
55
|
+
}
|
|
56
|
+
.kofi-banner h1 {
|
|
57
|
+
margin: 0;
|
|
58
|
+
margin-bottom: 10px;
|
|
59
|
+
font-size: var(--font-ui-large);
|
|
60
|
+
font-weight: 600;
|
|
61
|
+
}
|
|
62
|
+
.kofi-banner .progress-container {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: row;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-items: center;
|
|
67
|
+
}
|
|
68
|
+
.kofi-banner .progress-container progress {
|
|
69
|
+
background: transparent;
|
|
70
|
+
}
|
|
71
|
+
.kofi-banner .progress-container progress::-webkit-progress-bar {
|
|
72
|
+
background-color: var(--background-modifier-border);
|
|
73
|
+
border-radius: var(--input-radius);
|
|
74
|
+
}
|
|
75
|
+
.kofi-banner .progress-container progress::-webkit-progress-value {
|
|
76
|
+
background-color: var(--color-accent);
|
|
77
|
+
border-radius: var(--input-radius);
|
|
78
|
+
}
|
|
79
|
+
.kofi-banner .progress-container .hourly-rate {
|
|
80
|
+
margin-left: 10px;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
}
|
|
83
|
+
.kofi-banner .ac-kofi-button {
|
|
84
|
+
align-self: flex-end;
|
|
85
|
+
width: min-content;
|
|
86
|
+
height: min-content;
|
|
87
|
+
line-height: 0;
|
|
88
|
+
}
|
|
89
|
+
.kofi-banner .ac-kofi-button img {
|
|
90
|
+
min-width: 100px;
|
|
91
|
+
width: 25%;
|
|
92
|
+
max-width: 200px;
|
|
93
|
+
}
|
|
94
|
+
.canvas-wrapper > .document-search-container {
|
|
95
|
+
transform: translateZ(0);
|
|
96
|
+
margin: 0;
|
|
97
|
+
}
|
|
98
|
+
.canvas-wrapper:not(.mod-readonly) .show-while-readonly {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
.canvas-control-item[data-toggled=true] {
|
|
102
|
+
background-color: var(--color-accent);
|
|
103
|
+
}
|
|
104
|
+
.canvas-control-item[data-toggled=true] svg {
|
|
105
|
+
stroke: var(--text-on-accent);
|
|
106
|
+
}
|
|
107
|
+
.reactive-node,
|
|
108
|
+
.canvas-node[data-shape=database],
|
|
109
|
+
.canvas-node[data-shape=document],
|
|
110
|
+
.canvas-node[data-shape=predefined-process],
|
|
111
|
+
.canvas-node[data-shape=diamond] {
|
|
112
|
+
--border-color: rgb(var(--canvas-color));
|
|
113
|
+
--border-width: 3px;
|
|
114
|
+
--box-shadow: none;
|
|
115
|
+
}
|
|
116
|
+
.reactive-node.is-focused,
|
|
117
|
+
.is-focused.canvas-node[data-shape=database],
|
|
118
|
+
.is-focused.canvas-node[data-shape=document],
|
|
119
|
+
.is-focused.canvas-node[data-shape=predefined-process],
|
|
120
|
+
.is-focused.canvas-node[data-shape=diamond],
|
|
121
|
+
.reactive-node.is-selected,
|
|
122
|
+
.is-selected.canvas-node[data-shape=database],
|
|
123
|
+
.is-selected.canvas-node[data-shape=document],
|
|
124
|
+
.is-selected.canvas-node[data-shape=predefined-process],
|
|
125
|
+
.is-selected.canvas-node[data-shape=diamond] {
|
|
126
|
+
--border-color: var(--color-accent);
|
|
127
|
+
--border-width: 5px;
|
|
128
|
+
--box-shadow: var(--shadow-border-accent);
|
|
129
|
+
}
|
|
130
|
+
.reactive-node.is-themed,
|
|
131
|
+
.is-themed.canvas-node[data-shape=database],
|
|
132
|
+
.is-themed.canvas-node[data-shape=document],
|
|
133
|
+
.is-themed.canvas-node[data-shape=predefined-process],
|
|
134
|
+
.is-themed.canvas-node[data-shape=diamond] {
|
|
135
|
+
--border-color: rgba(var(--canvas-color), 0.7);
|
|
136
|
+
}
|
|
137
|
+
.reactive-node.is-themed.is-focused,
|
|
138
|
+
.is-themed.is-focused.canvas-node[data-shape=database],
|
|
139
|
+
.is-themed.is-focused.canvas-node[data-shape=document],
|
|
140
|
+
.is-themed.is-focused.canvas-node[data-shape=predefined-process],
|
|
141
|
+
.is-themed.is-focused.canvas-node[data-shape=diamond],
|
|
142
|
+
.reactive-node.is-themed.is-selected,
|
|
143
|
+
.is-themed.is-selected.canvas-node[data-shape=database],
|
|
144
|
+
.is-themed.is-selected.canvas-node[data-shape=document],
|
|
145
|
+
.is-themed.is-selected.canvas-node[data-shape=predefined-process],
|
|
146
|
+
.is-themed.is-selected.canvas-node[data-shape=diamond] {
|
|
147
|
+
--border-color: rgb(var(--canvas-color));
|
|
148
|
+
--box-shadow: var(--shadow-border-themed);
|
|
149
|
+
}
|
|
150
|
+
.canvas-node[data-text-align=center] .markdown-preview-view {
|
|
151
|
+
scrollbar-gutter: auto;
|
|
152
|
+
}
|
|
153
|
+
.canvas-node[data-text-align=center] .markdown-preview-view .markdown-preview-section {
|
|
154
|
+
display: flex;
|
|
155
|
+
flex-direction: column;
|
|
156
|
+
justify-content: center;
|
|
157
|
+
min-height: 0 !important;
|
|
158
|
+
text-align: center;
|
|
159
|
+
vertical-align: middle;
|
|
160
|
+
}
|
|
161
|
+
.canvas-node[data-text-align=right] {
|
|
162
|
+
text-align: right;
|
|
163
|
+
}
|
|
164
|
+
.canvas-node[data-shape] .canvas-node-container .markdown-preview-view.markdown-rendered {
|
|
165
|
+
transform: unset;
|
|
166
|
+
}
|
|
167
|
+
.canvas-node[data-shape=pill] .canvas-node-container {
|
|
168
|
+
border-radius: 5000px;
|
|
169
|
+
}
|
|
170
|
+
.canvas-node[data-shape=diamond] {
|
|
171
|
+
}
|
|
172
|
+
.canvas-node[data-shape=diamond].is-focused,
|
|
173
|
+
.canvas-node[data-shape=diamond].is-selected {
|
|
174
|
+
border-radius: var(--radius-m);
|
|
175
|
+
outline: 2px solid var(--color-accent);
|
|
176
|
+
outline-offset: 5px;
|
|
177
|
+
}
|
|
178
|
+
.canvas-node[data-shape=diamond] .canvas-node-container {
|
|
179
|
+
border: none;
|
|
180
|
+
box-shadow: none !important;
|
|
181
|
+
}
|
|
182
|
+
.canvas-node[data-shape=diamond] .canvas-node-container:not(:has(.embed-iframe)) {
|
|
183
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 141.42135624 141.42135624' preserveAspectRatio='none'%3E%3Cstyle%3E rect %7B transform-origin: center; transform: rotate(45deg) scale(1.05); %7D %3C/style%3E%3Crect rx='8' x='20.71067812' y='20.71067812' width='100' height='100' /%3E%3C/svg%3E");
|
|
184
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 141.42135624 141.42135624' preserveAspectRatio='none'%3E%3Cstyle%3E rect %7B transform-origin: center; transform: rotate(45deg) scale(1.05); %7D %3C/style%3E%3Crect rx='8' x='20.71067812' y='20.71067812' width='100' height='100' /%3E%3C/svg%3E");
|
|
185
|
+
mask-repeat: no-repeat;
|
|
186
|
+
-webkit-mask-repeat: no-repeat;
|
|
187
|
+
mask-size: 100%;
|
|
188
|
+
-webkit-mask-size: 100%;
|
|
189
|
+
}
|
|
190
|
+
.canvas-node[data-shape=diamond] .canvas-node-container .canvas-node-placeholder::after {
|
|
191
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 141.42135624 141.42135624' preserveAspectRatio='none'%3E%3Cstyle%3E rect %7B transform-origin: center; transform: rotate(45deg) scale(1.05); %7D %3C/style%3E%3Crect rx='8' x='20.71067812' y='20.71067812' width='100' height='100' /%3E%3C/svg%3E");
|
|
192
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 141.42135624 141.42135624' preserveAspectRatio='none'%3E%3Cstyle%3E rect %7B transform-origin: center; transform: rotate(45deg) scale(1.05); %7D %3C/style%3E%3Crect rx='8' x='20.71067812' y='20.71067812' width='100' height='100' /%3E%3C/svg%3E");
|
|
193
|
+
mask-repeat: no-repeat;
|
|
194
|
+
-webkit-mask-repeat: no-repeat;
|
|
195
|
+
mask-size: 100%;
|
|
196
|
+
-webkit-mask-size: 100%;
|
|
197
|
+
}
|
|
198
|
+
.canvas-node[data-shape=diamond]::before {
|
|
199
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 141.42135624 141.42135624' preserveAspectRatio='none'%3E%3Cstyle%3E rect %7B transform-origin: center; transform: rotate(45deg) scale(1.05); %7D %3C/style%3E%3Crect rx='8' x='20.71067812' y='20.71067812' width='100' height='100' /%3E%3C/svg%3E");
|
|
200
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 141.42135624 141.42135624' preserveAspectRatio='none'%3E%3Cstyle%3E rect %7B transform-origin: center; transform: rotate(45deg) scale(1.05); %7D %3C/style%3E%3Crect rx='8' x='20.71067812' y='20.71067812' width='100' height='100' /%3E%3C/svg%3E");
|
|
201
|
+
mask-repeat: no-repeat;
|
|
202
|
+
-webkit-mask-repeat: no-repeat;
|
|
203
|
+
mask-size: 100%;
|
|
204
|
+
-webkit-mask-size: 100%;
|
|
205
|
+
content: "";
|
|
206
|
+
position: absolute;
|
|
207
|
+
top: calc(var(--border-width) * -1);
|
|
208
|
+
left: calc(var(--border-width) * -1);
|
|
209
|
+
width: calc(100% + var(--border-width) * 2);
|
|
210
|
+
height: calc(100% + var(--border-width) * 2);
|
|
211
|
+
background-color: var(--border-color);
|
|
212
|
+
}
|
|
213
|
+
.canvas-node[data-shape=parallelogram] .canvas-node-container {
|
|
214
|
+
transform: skewX(-20deg);
|
|
215
|
+
backface-visibility: hidden;
|
|
216
|
+
}
|
|
217
|
+
.canvas-node[data-shape=parallelogram] .canvas-node-container .canvas-node-content .markdown-embed-content {
|
|
218
|
+
transform: skewX(20deg);
|
|
219
|
+
}
|
|
220
|
+
.canvas-node[data-shape=circle] .canvas-node-container {
|
|
221
|
+
border-radius: 50%;
|
|
222
|
+
}
|
|
223
|
+
.canvas-node[data-shape=circle] .canvas-node-container .markdown-preview-view {
|
|
224
|
+
overflow-y: initial;
|
|
225
|
+
}
|
|
226
|
+
.canvas-node[data-shape=predefined-process] .canvas-node-container .canvas-node-content {
|
|
227
|
+
padding: 0 10px;
|
|
228
|
+
}
|
|
229
|
+
.canvas-node[data-shape=predefined-process] .canvas-node-container::before,
|
|
230
|
+
.canvas-node[data-shape=predefined-process] .canvas-node-container::after {
|
|
231
|
+
content: "";
|
|
232
|
+
z-index: 1;
|
|
233
|
+
position: absolute;
|
|
234
|
+
top: 0;
|
|
235
|
+
width: 0;
|
|
236
|
+
height: 100%;
|
|
237
|
+
border-left: var(--border-width) solid var(--border-color);
|
|
238
|
+
}
|
|
239
|
+
.canvas-node[data-shape=predefined-process] .canvas-node-container::before {
|
|
240
|
+
left: calc(10px - var(--border-width));
|
|
241
|
+
}
|
|
242
|
+
.canvas-node[data-shape=predefined-process] .canvas-node-container::after {
|
|
243
|
+
right: calc(10px - var(--border-width));
|
|
244
|
+
}
|
|
245
|
+
.canvas-node[data-shape=document] {
|
|
246
|
+
--border-width: 2.5px;
|
|
247
|
+
filter: drop-shadow(0 var(--border-width) 0 var(--border-color)) drop-shadow(0 calc(var(--border-width) * -1) 0 var(--border-color));
|
|
248
|
+
}
|
|
249
|
+
.canvas-node[data-shape=document] .canvas-node-container {
|
|
250
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 75 45' preserveAspectRatio='none'%3E%3Cpath d='M75 0 75 39.375Q56.25 29.25 37.5 39.375 18.75 49.5 0 39.375L0 0Z' /%3E%3C/svg%3E");
|
|
251
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 75 45' preserveAspectRatio='none'%3E%3Cpath d='M75 0 75 39.375Q56.25 29.25 37.5 39.375 18.75 49.5 0 39.375L0 0Z' /%3E%3C/svg%3E");
|
|
252
|
+
mask-repeat: no-repeat;
|
|
253
|
+
-webkit-mask-repeat: no-repeat;
|
|
254
|
+
mask-size: 100%;
|
|
255
|
+
-webkit-mask-size: 100%;
|
|
256
|
+
border: var(--border-width) solid var(--border-color);
|
|
257
|
+
border-top: none;
|
|
258
|
+
border-bottom: none;
|
|
259
|
+
}
|
|
260
|
+
.canvas-node[data-shape=document].is-focused,
|
|
261
|
+
.canvas-node[data-shape=document].is-selected {
|
|
262
|
+
--border-width: 4px;
|
|
263
|
+
}
|
|
264
|
+
.canvas-node[data-shape=database] {
|
|
265
|
+
}
|
|
266
|
+
.canvas-node[data-shape=database] .canvas-node-container {
|
|
267
|
+
border: var(--border-width) solid var(--border-color);
|
|
268
|
+
border-bottom: 0;
|
|
269
|
+
border-top: 0;
|
|
270
|
+
border-radius: 0;
|
|
271
|
+
box-shadow: none !important;
|
|
272
|
+
}
|
|
273
|
+
.canvas-node[data-shape=database] .canvas-node-container .canvas-node-placeholder {
|
|
274
|
+
transform: translateY(25px);
|
|
275
|
+
}
|
|
276
|
+
.canvas-node[data-shape=database]::before,
|
|
277
|
+
.canvas-node[data-shape=database]::after {
|
|
278
|
+
content: "";
|
|
279
|
+
position: absolute;
|
|
280
|
+
left: 0;
|
|
281
|
+
box-sizing: border-box;
|
|
282
|
+
width: 100%;
|
|
283
|
+
height: 50px;
|
|
284
|
+
border-radius: 50%;
|
|
285
|
+
border: var(--border-width) solid var(--border-color);
|
|
286
|
+
background-color: var(--background-primary);
|
|
287
|
+
}
|
|
288
|
+
.canvas-node[data-shape=database]::after {
|
|
289
|
+
top: -25px;
|
|
290
|
+
}
|
|
291
|
+
.canvas-node[data-shape=database]::before {
|
|
292
|
+
bottom: -25px;
|
|
293
|
+
}
|
|
294
|
+
.canvas-node[data-shape=database].is-themed .canvas-node-content {
|
|
295
|
+
background-color: transparent;
|
|
296
|
+
}
|
|
297
|
+
.canvas-node[data-shape=database].is-themed:not(:has(.embed-iframe)) .canvas-node-container,
|
|
298
|
+
.canvas-node[data-shape=database].is-themed:not(:has(.embed-iframe))::after,
|
|
299
|
+
.canvas-node[data-shape=database].is-themed:not(:has(.embed-iframe))::before {
|
|
300
|
+
box-shadow: inset 0 0 0 1000px rgba(var(--canvas-color), 0.07) !important;
|
|
301
|
+
}
|
|
302
|
+
.canvas-node[data-shape=database] .canvas-node-content:not(:has(.embed-iframe)) {
|
|
303
|
+
transform: translateY(20px);
|
|
304
|
+
}
|
|
305
|
+
.canvas-node[data-shape=database]:has(.embed-iframe)::after {
|
|
306
|
+
z-index: -1;
|
|
307
|
+
}
|
|
308
|
+
.canvas-node[data-border=dashed] .canvas-node-container {
|
|
309
|
+
box-shadow: none;
|
|
310
|
+
border-style: dashed;
|
|
311
|
+
}
|
|
312
|
+
.canvas-node[data-border=dotted] .canvas-node-container {
|
|
313
|
+
box-shadow: none;
|
|
314
|
+
border-style: dotted;
|
|
315
|
+
}
|
|
316
|
+
.canvas-node[data-border=invisible] {
|
|
317
|
+
box-shadow: none;
|
|
318
|
+
}
|
|
319
|
+
.canvas-node[data-border=invisible]:not(.is-focused):not(.is-selected) .canvas-node-container {
|
|
320
|
+
border-color: transparent !important;
|
|
321
|
+
}
|
|
322
|
+
.canvas-node[data-border=invisible] .canvas-node-label {
|
|
323
|
+
display: none;
|
|
324
|
+
}
|
|
325
|
+
.canvas-node[data-border=invisible] .canvas-node-container {
|
|
326
|
+
background-color: transparent;
|
|
327
|
+
box-shadow: none;
|
|
328
|
+
}
|
|
329
|
+
.canvas-node[data-border][data-shape=predefined-process] {
|
|
330
|
+
--border-width: 2px;
|
|
331
|
+
}
|
|
332
|
+
.canvas-node[data-border][data-shape=predefined-process] .is-focused,
|
|
333
|
+
.canvas-node[data-border][data-shape=predefined-process] .is-selected {
|
|
334
|
+
--border-width: 2px;
|
|
335
|
+
}
|
|
336
|
+
.canvas-node[data-border=dashed][data-shape=predefined-process] .canvas-node-container::before,
|
|
337
|
+
.canvas-node[data-border=dashed][data-shape=predefined-process] .canvas-node-container::after {
|
|
338
|
+
border-left: var(--border-width) dashed var(--border-color);
|
|
339
|
+
}
|
|
340
|
+
.canvas-node[data-border=dotted][data-shape=predefined-process] .canvas-node-container::before,
|
|
341
|
+
.canvas-node[data-border=dotted][data-shape=predefined-process] .canvas-node-container::after {
|
|
342
|
+
border-left: var(--border-width) dotted var(--border-color);
|
|
343
|
+
}
|
|
344
|
+
.canvas-node[data-border][data-shape=document] .canvas-node-container {
|
|
345
|
+
border-top: none;
|
|
346
|
+
border-bottom: none;
|
|
347
|
+
}
|
|
348
|
+
.canvas-edges path[data-path=dotted] {
|
|
349
|
+
stroke-dasharray: calc(3px * var(--zoom-multiplier));
|
|
350
|
+
}
|
|
351
|
+
.canvas-edges path[data-path=short-dashed] {
|
|
352
|
+
stroke-dasharray: 9px;
|
|
353
|
+
}
|
|
354
|
+
.canvas-edges path[data-path=long-dashed] {
|
|
355
|
+
stroke-dasharray: 18px;
|
|
356
|
+
}
|
|
357
|
+
.canvas-edges [data-arrow=triangle-outline] polygon,
|
|
358
|
+
.canvas-edges [data-arrow=diamond-outline] polygon,
|
|
359
|
+
.canvas-edges [data-arrow=circle-outline] polygon {
|
|
360
|
+
fill: var(--canvas-background);
|
|
361
|
+
stroke: rgb(var(--canvas-color));
|
|
362
|
+
stroke-width: calc(3px * var(--zoom-multiplier));
|
|
363
|
+
}
|
|
364
|
+
.canvas-edges [data-arrow=thin-triangle] polygon {
|
|
365
|
+
fill: transparent;
|
|
366
|
+
stroke: rgb(var(--canvas-color));
|
|
367
|
+
stroke-width: calc(4px * var(--zoom-multiplier));
|
|
368
|
+
}
|
|
369
|
+
.canvas.is-exporting {
|
|
370
|
+
--zoom-multiplier: 1;
|
|
371
|
+
}
|
|
372
|
+
.canvas.is-exporting * {
|
|
373
|
+
pointer-events: none !important;
|
|
374
|
+
transition: none !important;
|
|
375
|
+
}
|
|
376
|
+
.canvas.is-exporting .collapse-button {
|
|
377
|
+
display: none;
|
|
378
|
+
}
|
|
379
|
+
.canvas.is-exporting #watermark-ac {
|
|
380
|
+
z-index: 9999999;
|
|
381
|
+
position: absolute;
|
|
382
|
+
}
|
|
383
|
+
.canvas-wrapper[data-collapsible-groups-feature-enabled=true] .canvas.is-exporting .canvas-node .canvas-group-label {
|
|
384
|
+
left: 0;
|
|
385
|
+
}
|
|
386
|
+
.progress-bar-modal-ac {
|
|
387
|
+
margin-top: 0.75em;
|
|
388
|
+
}
|
|
389
|
+
.progress-bar-modal-ac.error .setting-progress-bar {
|
|
390
|
+
color: var(--color-error);
|
|
391
|
+
}
|
|
392
|
+
.canvas-wrapper[data-disable-font-size-relative-to-zoom=true] {
|
|
393
|
+
--zoom-multiplier: 1 !important;
|
|
394
|
+
}
|
|
395
|
+
.canvas-wrapper.mod-readonly[data-hide-background-grid-when-in-readonly=true] .canvas-background {
|
|
396
|
+
visibility: hidden;
|
|
397
|
+
}
|
|
398
|
+
.collapse-button {
|
|
399
|
+
position: absolute;
|
|
400
|
+
left: 0;
|
|
401
|
+
top: calc(-1 * var(--size-4-1) * var(--zoom-multiplier));
|
|
402
|
+
padding: var(--size-4-1) var(--size-4-2);
|
|
403
|
+
transform-origin: bottom left;
|
|
404
|
+
transform: translate(0, -100%) scale(var(--zoom-multiplier));
|
|
405
|
+
border-radius: var(--radius-s);
|
|
406
|
+
color: var(--text-muted);
|
|
407
|
+
background-color: rgba(var(--canvas-color), 0.1);
|
|
408
|
+
font-size: 1.5em;
|
|
409
|
+
line-height: 1;
|
|
410
|
+
pointer-events: initial;
|
|
411
|
+
cursor: pointer;
|
|
412
|
+
transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
|
|
413
|
+
}
|
|
414
|
+
.canvas-wrapper[data-collapsible-groups-feature-enabled=true] .canvas-node .canvas-group-label {
|
|
415
|
+
left: calc(40px * var(--zoom-multiplier));
|
|
416
|
+
}
|
|
417
|
+
.canvas-node[data-collapsed] .canvas-node-container {
|
|
418
|
+
display: none;
|
|
419
|
+
}
|
|
420
|
+
.canvas-node[data-collapsed] .canvas-group-label {
|
|
421
|
+
max-width: initial;
|
|
422
|
+
}
|
|
423
|
+
.canvas-wrapper[data-collapsed-group-preview-on-drag=true][data-is-dragging] .canvas-node[data-collapsed] .canvas-node-container {
|
|
424
|
+
display: block;
|
|
425
|
+
opacity: 0.5;
|
|
426
|
+
border-style: dashed;
|
|
427
|
+
}
|
|
428
|
+
.canvas-wrapper[data-collapsed-group-preview-on-drag=true][data-is-dragging] .canvas-node[data-collapsed] .canvas-node-container .canvas-node-content {
|
|
429
|
+
background-color: transparent;
|
|
430
|
+
}
|
|
431
|
+
.canvas-node-interaction-layer[data-target-collapsed] .canvas-node-resizer {
|
|
432
|
+
pointer-events: none;
|
|
433
|
+
cursor: inherit;
|
|
434
|
+
}
|
|
435
|
+
.canvas-node-interaction-layer[data-target-collapsed] .canvas-node-resizer .canvas-node-connection-point {
|
|
436
|
+
display: none;
|
|
437
|
+
pointer-events: none;
|
|
438
|
+
}
|
|
439
|
+
.canvas-wrapper[data-allow-floating-edge-creation=true] .canvas.is-connecting .canvas-node:not(.canvas-node-group)::after {
|
|
440
|
+
all: unset;
|
|
441
|
+
content: "";
|
|
442
|
+
z-index: 100;
|
|
443
|
+
position: absolute;
|
|
444
|
+
top: 50%;
|
|
445
|
+
left: 50%;
|
|
446
|
+
width: max(10px, 100% - 50px * var(--zoom-multiplier) * 2);
|
|
447
|
+
height: max(10px, 100% - 50px * var(--zoom-multiplier) * 2);
|
|
448
|
+
transform: translate(-50%, -50%);
|
|
449
|
+
border-radius: var(--radius-m);
|
|
450
|
+
outline: calc(4px * var(--zoom-multiplier)) dashed hsla(var(--color-accent-hsl), 0.5);
|
|
451
|
+
}
|
|
452
|
+
.canvas-wrapper[data-allow-floating-edge-creation=true] .canvas.is-connecting .canvas-node:not(.canvas-node-group).hovering-floating-edge-zone::after {
|
|
453
|
+
outline-color: var(--color-accent);
|
|
454
|
+
outline-style: solid;
|
|
455
|
+
background-color: hsla(var(--color-accent-hsl), 0.1);
|
|
456
|
+
}
|
|
457
|
+
.canvas-wrapper[data-focus-mode-enabled=true] .canvas:has(.canvas-node.is-focused) .canvas-node:not(.is-focused) {
|
|
458
|
+
filter: blur(5px);
|
|
459
|
+
}
|
|
460
|
+
.canvas-wrapper[data-focus-mode-enabled=true] .canvas:has(.canvas-node.is-focused) .canvas-edges {
|
|
461
|
+
filter: blur(5px);
|
|
462
|
+
}
|
|
463
|
+
.canvas-wrapper[data-focus-mode-enabled=true] .canvas:has(.canvas-node.is-focused) .canvas-path-label-wrapper {
|
|
464
|
+
filter: blur(5px);
|
|
465
|
+
}
|
|
466
|
+
.canvas-wrapper.presentation-mode .canvas-controls {
|
|
467
|
+
visibility: hidden;
|
|
468
|
+
}
|
|
469
|
+
.canvas-wrapper.presentation-mode .canvas-card-menu {
|
|
470
|
+
visibility: hidden;
|
|
471
|
+
}
|
|
472
|
+
.canvas-wrapper:not(.presentation-mode) .canvas-node[data-is-start-node=true]::before {
|
|
473
|
+
content: "Start";
|
|
474
|
+
position: absolute;
|
|
475
|
+
top: calc(-1 * var(--size-4-1) * var(--zoom-multiplier));
|
|
476
|
+
right: 0;
|
|
477
|
+
transform: translate(0, -100%) scale(var(--zoom-multiplier));
|
|
478
|
+
transform-origin: bottom right;
|
|
479
|
+
max-width: calc(100% / var(--zoom-multiplier));
|
|
480
|
+
padding: var(--size-4-1) var(--size-4-2);
|
|
481
|
+
font-size: 1em;
|
|
482
|
+
border-radius: var(--radius-s);
|
|
483
|
+
color: var(--color-green);
|
|
484
|
+
background-color: rgba(var(--color-green-rgb), 0.1);
|
|
485
|
+
}
|
|
486
|
+
.canvas-node[data-is-portal-loaded=true] {
|
|
487
|
+
pointer-events: all;
|
|
488
|
+
}
|
|
489
|
+
.canvas-node[data-is-portal-loaded=true]:not(.is-focused) {
|
|
490
|
+
pointer-events: none;
|
|
491
|
+
}
|
|
492
|
+
.canvas-node[data-is-portal-loaded=true]:not(.is-focused) .canvas-node-label {
|
|
493
|
+
pointer-events: all;
|
|
494
|
+
}
|
|
495
|
+
.canvas-node[data-is-portal-loaded=true] .canvas-node-container {
|
|
496
|
+
background-color: transparent;
|
|
497
|
+
border-style: dashed;
|
|
498
|
+
}
|
|
499
|
+
.canvas-node[data-is-portal-loaded=true] .canvas-node-container .canvas-node-content {
|
|
500
|
+
display: none;
|
|
501
|
+
}
|
|
502
|
+
.canvas-node-interaction-layer[data-is-from-portal=true] .canvas-node-resizer {
|
|
503
|
+
pointer-events: none;
|
|
504
|
+
cursor: inherit;
|
|
505
|
+
}
|
|
506
|
+
.canvas-node-interaction-layer[data-is-from-portal=true] .canvas-node-resizer .canvas-node-connection-point {
|
|
507
|
+
pointer-events: all;
|
|
508
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*
|
|
2
|
+
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
3
|
+
if you want to view the source, please visit the github repository of this plugin
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
var _=Object.defineProperty;var pe=Object.getOwnPropertyDescriptor;var fe=Object.getOwnPropertyNames;var me=Object.prototype.hasOwnProperty;var Ce=(n,i)=>{for(var s in i)_(n,s,{get:i[s],enumerable:!0})},ye=(n,i,s,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let e of fe(i))!me.call(n,e)&&e!==s&&_(n,e,{get:()=>i[e],enumerable:!(t=pe(i,e))||t.enumerable});return n};var Te=n=>ye(_({},"__esModule",{value:!0}),n);var Me={};Ce(Me,{default:()=>X});module.exports=Te(Me);var f=require("obsidian");function L(n,i){let s=Object.keys(i).map(t=>ve(n,t,i[t]));return s.length===1?s[0]:function(){s.forEach(t=>t())}}function ve(n,i,s){let t=n[i],e=n.hasOwnProperty(i),o=e?t:function(){return Object.getPrototypeOf(n)[i].apply(this,arguments)},a=s(o);return t&&Object.setPrototypeOf(a,t),Object.setPrototypeOf(r,a),n[i]=r,d;function r(...l){return a===o&&n[i]===r&&d(),a.apply(this,l)}function d(){n[i]===r&&(e?n[i]=o:delete n[i]),a!==o&&(a=o,Object.setPrototypeOf(r,t||Function))}}var F=n=>{let i=[];for(let s=0;s<n;s++)i.push((16*Math.random()|0).toString(16));return i.join("")},te=(n,i,s,t,e)=>{let o=U(n,F(16),{x:i.x+i.width+200,y:e,width:i.width,height:i.height*.6,type:"file",content:s.path,subpath:t});return j(n,F(16),{fromOrTo:"from",side:"right",node:i},{fromOrTo:"to",side:"left",node:o}),n.requestSave(),o},U=(n,i,{x:s,y:t,width:e,height:o,type:a,content:r,subpath:d})=>{if(!n)return;let l=n.getData();if(!l)return;let h={id:i,x:s,y:t,width:e,height:o,type:a};switch(a){case"text":h.text=r;break;case"file":h.file=r,d&&(h.subpath=d);break}return n.importData({nodes:[...l.nodes,h],edges:l.edges}),n.requestFrame(),h},j=(n,i,s,t)=>{if(!n)return;let e=n.getData();!e||(n.importData({edges:[...e.edges,{id:i,fromNode:s.node.id,fromSide:s.side,toNode:t.node.id,toSide:t.side}],nodes:e.nodes}),n.requestFrame())},se=(n,i,s)=>{let t=n.getEdgesForNode(i),e=E(s),o=w(e);return t.some(a=>a.from.node.id===i.id&&a.from.side===e&&a.to.side===o)},ie=(n,i,s)=>{let t=[i],e=new Set([i]),o=E(s),a=w(o);for(;t.length>0;){let l=t.pop();n.getEdgesForNode(l).forEach(h=>{h.from.node.id===l.id&&h.from.side===o&&h.to.side===a&&!e.has(h.to.node)&&(e.add(h.to.node),t.push(h.to.node))})}let r=n.nodes;return Array.from(e.values()).filter(l=>r.has(l.id))},ne=(n,i,s)=>{let t=ie(n,i,s);return n.deselectAll(),t.forEach(e=>{n.select(e)}),t},oe=(n,i,s)=>{let t=ie(n,i,s),e=Math.min(...t.map(d=>d.x-d.width/2)),o=Math.min(...t.map(d=>d.y-d.height/2)),a=Math.max(...t.map(d=>d.x+d.width/2)),r=Math.max(...t.map(d=>d.y+d.height/2));return{minX:e,minY:o,maxX:a,maxY:r}},xe=(n,i,s)=>{let t=i.settings.layout.direction,e=t==="TB"||t==="BT",o=E(t),a=w(o),r=e?i.settings.create.parentChildGapForVertical:i.settings.create.parentChildGapForHorizontal,d=i.settings.create.siblingTolerance||10,l=(g,u)=>{if(e){let y=Math.abs(u.y-(g.y+g.height));return y>=r&&y<=r+d}else{let y=Math.abs(u.x-(g.x+g.width));return y>=r&&y<=r+d}},h=n.getEdgesForNode(s).find(g=>g.to.node.id===s.id&&g.from.side===o&&g.to.side===a);if(h){let g=h.from.node;return n.getEdgesForNode(g).filter(u=>u.from.node.id===g.id&&u.from.side===o&&u.to.side===a).map(u=>u.to.node).filter(u=>l(g,u)&&u.id!==s.id).sort((u,y)=>e?u.x-y.x:u.y-y.y)}return[]},ae=(n,i,s)=>{let t=i.settings.layout.direction,e=t==="TB"||t==="BT",o=E(t),a=w(o),r=xe(n,i,s);if(r.length>0){let d=e?s.x:s.y;return r.reduce((l,h)=>{let g=Math.abs((e?l.x:l.y)-d);return Math.abs((e?h.x:h.y)-d)<g?h:l})}else{let d=n.getEdgesForNode(s).find(l=>l.to.node.id===s.id&&l.from.side===o&&l.to.side===a);if(d)return d.from.node;{let l=Array.from(n.nodes.values()).filter(h=>!n.getEdgesForNode(h).some(g=>g.to.node.id===h.id&&g.from.side===o&&g.to.side===a));return l.length>0?l[0]:null}}},w=n=>{switch(n){case"top":return"bottom";case"bottom":return"top";case"left":return"right";case"right":return"left"}},E=n=>{switch(n){case"TB":return"bottom";case"BT":return"top";case"LR":return"right";case"RL":return"left"}};function be(n,i){let s=n.x,t=n.x+n.width,e=n.y,o=n.y+n.height,a=i.x,r=i.x+i.width,d=i.y,l=i.y+i.height;return Math.abs(o-d)<=20&&s<r&&t>a}function Se(n,i){let s=n.x,t=n.x+n.width,e=n.y,o=n.y+n.height,a=i.x,r=i.x+i.width,d=i.y,l=i.y+i.height;return Math.abs(t-a)<=20&&e<l&&o>d}function P({movedNode:n,nodes:i},{adjustedHeight:s,adjustedWidth:t}){let e=[];for(let o of i){let a=o.bbox.minX,r=o.bbox.minY;o.label||(be(n,o)&&s!==0?(e.push({node:o,moveTo:{x:a,y:r+s+20}}),P({movedNode:o,nodes:i.filter(d=>d.id!==n.id)},{adjustedHeight:s,adjustedWidth:0})):Se(n,o)&&t!==0&&(e.push({node:o,moveTo:{x:a+t,y:r}}),P({movedNode:o,nodes:i.filter(d=>d.id!==n.id)},{adjustedHeight:0,adjustedWidth:t})))}e.forEach(({node:o,moveTo:a})=>{o.moveTo(a)})}var p=require("obsidian"),re={navigate:{useNavigate:!0,modifierKey:["Alt"]},hotkey:{hotkeyMode:"Space"},create:{createFloat:!0,createCustomChildNode:!0,childNodeWidth:200,childNodeHeight:100,floatGap:100,floatWidth:200,floatHeight:100,parentChildGapForVertical:160,parentChildGapForHorizontal:200,siblingGapForVertical:50,siblingGapForHorizontal:40,siblingTolerance:50},layout:{direction:"LR",autoLayout:!0,autoLayoutDirection:"LR",autoHeight:!0,ignoreFilesRegex:""},resize:{autoResize:!1,widthAutoResize:!1,maxWidth:500},advanced:{transferToCommands:!1,showChangelogAutomatically:!0,lastUpdatedVersion:"0.0.0"}},Y=class extends p.PluginSettingTab{constructor(s,t){super(s,t);this.applySettingsUpdate=(0,p.debounce)(async()=>{await this.plugin.saveSettings(),console.log("debounce")},300,!0);this.plugin=t}updateSettings(s,t){this.plugin.settings={...this.plugin.settings,[s.split(".")[0]]:{...this.plugin.settings[s.split(".")[0]],[s.split(".")[1]]:t}},this.applySettingsUpdate()}display(){let{containerEl:s}=this;s.empty(),new p.Setting(s).setName("Donate").setDesc("If you like this plugin, consider donating to support continued development:").addButton(t=>{t.setButtonText("Buy me a coffee").setCta(),t.onClick(()=>{window.open("https://www.buymeacoffee.com/boninall","_blank")})}),this.useNavigateHotkeySetting(s,this.plugin.settings),this.layoutSettings(s,this.plugin.settings),this.hotkeySettings(s,this.plugin.settings),this.createFloatSetting(s,this.plugin.settings),this.resizeSettings(s,this.plugin.settings),new p.Setting(s).setName("Changelog").setDesc("Auto show the changelog of the plugin when the plugin is updated.").addToggle(t=>{t.setValue(this.plugin.settings.advanced.showChangelogAutomatically),t.onChange(e=>{this.updateSettings("advanced.showChangelogAutomatically",e)})})}useNavigateHotkeySetting(s,t){let e=document.createDocumentFragment();e.createDiv({cls:"mind-map-setting-desc"},o=>{o.createEl("span",{text:"You can use the hotkey to navigate the mind map."}),o.createEl("ul",{},a=>{a.createEl("li",{},r=>{r.setText("Arrow: Move selected node")})}),o.createEl("ul",{},a=>{a.createEl("li",{},r=>{r.setText("Alt+Arrow: Select nearest node in the direction")})})}),new p.Setting(s).setName("Use navigate hotkey").setDesc(e).addToggle(o=>{o.setValue(t.navigate.useNavigate),o.onChange(a=>{this.updateSettings("navigate.useNavigate",a),setTimeout(()=>{this.display()},700)})})}hotkeySettings(s,t){new p.Setting(s).setName("Hotkey").setHeading();let e=document.createDocumentFragment();e.createDiv({cls:"mind-map-setting-desc"},o=>{o.createEl("span",{text:"You can change the hotkey mode to control how you edit the node."})}),e.createDiv({cls:"mind-map-setting-desc"},o=>{o.setText("When you choose 'Space': "),o.createEl("ul",{},a=>{a.createEl("li",{},r=>{r.setText("Space: Edit node")}),a.createEl("li",{},r=>{r.setText("Enter: Create new sibling node")}),a.createEl("li",{},r=>{r.setText("Mod+Enter: Create new previous sibling node")})})}),e.createDiv({cls:"mind-map-setting-desc"},o=>{o.setText("When you choose 'Enter': "),o.createEl("ul",{},a=>{a.createEl("li",{},r=>{r.setText("Enter: Edit node")}),a.createEl("li",{},r=>{r.setText("Mod+Enter: Create new sibling node")}),a.createEl("li",{},r=>{r.setText("Mod+Shift+Enter: Create new previous sibling node")})})}),new p.Setting(s).setName("Hotkey mode").setDesc(e).addDropdown(o=>{o.addOption("Space","Space"),o.addOption("Enter","Enter"),o.setValue(t.hotkey.hotkeyMode||"Space"),o.onChange(a=>{a!==t.hotkey.hotkeyMode&&this.app.workspace.getLeavesOfType("canvas").forEach(r=>{r.rebuildView()}),this.updateSettings("hotkey.hotkeyMode",a)})})}layoutSettings(s,t){new p.Setting(s).setName("Layout").setDesc("Set the layout of the mind map. Notice: any changes will take effect after creating a new node/deleting a node.").setHeading(),new p.Setting(s).setName("Width of new node").setDesc("The width of the new node").addSlider(e=>{e.setLimits(100,500,10),e.setDynamicTooltip(),e.setValue(t.create.childNodeWidth||200),e.onChange(o=>{this.updateSettings("create.childNodeWidth",o)})}),new p.Setting(s).setName("Height of new node").setDesc("The height of the new node").addSlider(e=>{e.setLimits(50,300,10),e.setDynamicTooltip(),e.setValue(t.create.childNodeHeight||100),e.onChange(o=>{this.updateSettings("create.childNodeHeight",o)})}),new p.Setting(s).setName("Auto Layout").setDesc("Auto layout the mind map").addToggle(e=>{e.setValue(t.layout.autoLayout),e.onChange(o=>{this.updateSettings("layout.autoLayout",o),setTimeout(()=>{this.display()},700)})}),t.layout.autoLayout&&(new p.Setting(s).setName("Direction").setDesc("Set the direction of the mind map.").addDropdown(e=>{e.addOption("TB","Top to bottom"),e.addOption("BT","Bottom to top"),e.addOption("LR","Left to right"),e.addOption("RL","Right to left"),e.setValue(t.layout.direction||"LR"),e.onChange(o=>{this.updateSettings("layout.direction",o),setTimeout(()=>{this.display()},400)})}),s.createDiv({cls:"mind-map-demo"},e=>{let a=`flowchart ${t.layout.direction==="TB"?"TB":t.layout.direction==="BT"?"BT":t.layout.direction==="LR"?"LR":"RL"}`;p.MarkdownRenderer.render(this.plugin.app,"```mermaid\n"+a+'\n I("Parent") --> D("B Children")\n I --> H("A Children")\n```',e,"",this.plugin)}),this.createGapSettings(s,t),new p.Setting(s).setName("Sibling Tolerance").setDesc("The tolerance of the sibling node. Used to determine if a node is a valid child.").addSlider(e=>{e.setLimits(20,200,1),e.setDynamicTooltip(),e.setValue(t.create.siblingTolerance||50),e.onChange(o=>{this.updateSettings("create.siblingTolerance",o)})}),new p.Setting(s).setName("Ignore Files").setDesc("The files that will be ignored when auto layout. Use regex to filter the files.").addText(e=>{e.setPlaceholder("e.g. He(.*)ld"),e.setValue(t.layout.ignoreFilesRegex||""),e.onChange(o=>{this.updateSettings("layout.ignoreFilesRegex",o)})}))}createGapSettings(s,t){switch(t.layout.direction){case"TB":case"BT":this.createVerticalGapSettings(s,t);break;case"LR":case"RL":this.createHorizontalGapSettings(s,t);break}}createVerticalGapSettings(s,t){new p.Setting(s).setName("Parent Child Gap (Vertical)").setDesc("The gap between parent and child node").addSlider(e=>{e.setLimits(100,500,10),e.setDynamicTooltip(),e.setValue(t.create.parentChildGapForVertical||160),e.onChange(o=>{this.updateSettings("create.parentChildGapForVertical",o)})}),new p.Setting(s).setName("Sibling Gap (Vertical)").setDesc("The gap between sibling node").addSlider(e=>{e.setLimits(10,100,10),e.setDynamicTooltip(),e.setValue(t.create.siblingGapForVertical||50),e.onChange(o=>{this.updateSettings("create.siblingGapForVertical",o)})})}createHorizontalGapSettings(s,t){new p.Setting(s).setName("Parent Child Gap (Horizontal)").setDesc("The gap between parent and child node").addSlider(e=>{e.setLimits(100,500,10),e.setDynamicTooltip(),e.setValue(t.create.parentChildGapForHorizontal||200),e.onChange(o=>{this.updateSettings("create.parentChildGapForHorizontal",o)})}),new p.Setting(s).setName("Sibling Gap (Horizontal)").setDesc("The gap between sibling node").addSlider(e=>{e.setLimits(10,100,10),e.setDynamicTooltip(),e.setValue(t.create.siblingGapForHorizontal||40),e.onChange(o=>{this.updateSettings("create.siblingGapForHorizontal",o)})})}createFloatSetting(s,t){new p.Setting(s).setName("Float").setHeading(),new p.Setting(s).setName("Create floating node").setDesc("Create a floating node").addToggle(e=>{e.setValue(t.create.createFloat),e.onChange(o=>{this.updateSettings("create.createFloat",o)})}),new p.Setting(s).setName("Create custom child node").setDesc("Create a custom child node with link to it. But cannot be used with auto layout.").addToggle(e=>{e.setValue(t.create.createCustomChildNode),e.onChange(o=>{this.updateSettings("create.createCustomChildNode",o)})}),new p.Setting(s).setName("Floating node gap").setDesc("The gap between floating node").addSlider(e=>{e.setLimits(0,500,10),e.setDynamicTooltip(),e.setValue(t.create.floatGap||100),e.onChange(o=>{this.updateSettings("create.floatGap",o)})}),new p.Setting(s).setName("Floating node width").setDesc("The width of the floating node").addSlider(e=>{e.setLimits(60,500,10),e.setDynamicTooltip(),e.setValue(t.create.floatWidth||200),e.onChange(o=>{this.updateSettings("create.floatWidth",o)})}),new p.Setting(s).setName("Floating node height").setDesc("The height of the floating node").addSlider(e=>{e.setLimits(60,500,10),e.setDynamicTooltip(),e.setValue(t.create.floatHeight||100),e.onChange(o=>{this.updateSettings("create.floatHeight",o)})})}resizeSettings(s,t){if(this.app.plugins.getPlugin("node-auto-resize"))return;let o=document.createDocumentFragment();o.createDiv({cls:"mind-map-setting-desc"},a=>{a.createEl("span",{text:"You can resize the node when you edit the node."}),a.createEl("span",{text:'Notice: if you already have "Node Auto Resize" plugin enabled, you can ignore this setting.'})}),new p.Setting(s).setName("Resize").setDesc(o).setHeading(),new p.Setting(s).setName("Auto resize").setDesc("If true, the node will be automatically resized when you edit the node.").addToggle(a=>{a.setValue(t.resize.autoResize),a.onChange(r=>{this.updateSettings("resize.autoResize",r)})}),new p.Setting(s).setName("Width auto resize").setDesc("If true, the width of the node will be automatically resized when you edit the node.").addToggle(a=>{a.setValue(t.resize.widthAutoResize),a.onChange(r=>{this.updateSettings("resize.widthAutoResize",r)})}),new p.Setting(s).setName("Max width").setDesc("The max width of the node. If the width of the node is greater than this value, the width of the node will be automatically resized to this value.").addSlider(a=>{a.setLimits(200,800,20),a.setDynamicTooltip(),a.setValue(t.resize.maxWidth||400),a.onChange(r=>{this.updateSettings("resize.maxWidth",r)})})}};var de=async(n,i,s,t,e)=>{j(s,F(16),{fromOrTo:"from",side:t,node:n},{fromOrTo:"to",side:e,node:i})},H=(n,i,s)=>{var h;if(i.readonly)return;let t=i.selection,e=n.settings;if(t.size!==1||t.values().next().value.isEditing)return;let o=t.values().next().value,a=s==="left"?o.x-o.width-e.create.floatGap:s==="right"?o.x+o.width+e.create.floatGap:o.x,r=s==="top"?o.y-o.height-e.create.floatGap:s==="bottom"?o.y+o.height+e.create.floatGap:o.y,d=U(i,F(16),{x:a,y:r,width:e.create.floatWidth||o.width,height:e.create.floatHeight||o.height,type:"text",content:""});i==null||i.requestSave();let l=(h=i.nodes)==null?void 0:h.get(d==null?void 0:d.id);if(!!l)return i.selectOnly(l),i.zoomToSelection(),setTimeout(()=>{l.startEditing()},100),d},K=async(n,i,s,t,e,o="default")=>{var v,C;let a={x:0,y:0},r=n.settings,d=r.create.childNodeWidth?r.create.childNodeWidth:s.width,l=r.create.childNodeHeight?r.create.childNodeHeight:s.height;if(e)switch(t){case"TB":a={x:s.x,y:s.y+s.height/2+n.settings.create.parentChildGapForVertical+l/2};break;case"BT":a={x:s.x,y:s.y-s.height/2-n.settings.create.parentChildGapForVertical-l/2};break;case"LR":a={x:s.x+s.width/2+n.settings.create.parentChildGapForHorizontal+d/2,y:s.y};break;case"RL":a={x:s.x-s.width/2-n.settings.create.parentChildGapForHorizontal-d/2,y:s.y};break}else{let b=t==="TB"||t==="BT"?n.settings.create.siblingGapForVertical:n.settings.create.siblingGapForHorizontal;switch(t){case"TB":case"BT":a={x:s.x+(o==="prev"?-1:1)*(s.width/2+b+d/2),y:s.y};break;case"LR":case"RL":a={x:s.x,y:s.y+(o==="prev"?-1:1)*(s.height/2+b+l/2)};break}}let h=U(i,F(16),{x:a.x-(!e&&(t==="BT"||t==="TB")?1:0)*(o==="prev"?-1:1),y:a.y-(!e&&(t==="LR"||t==="RL")?1:0)*(o==="prev"?-1:1),width:d,height:l,type:"text",content:""}),g=E(t),u=w(g);if(!h)return;if(e)await de(s,h,i,g,u);else{let b=(v=i.getEdgesForNode(s).find(S=>S.to.node.id===s.id&&S.from.side===g&&S.to.side===u))==null?void 0:v.from.node;b&&await de(b,h,i,g,u)}i.deselectAll();let y=(C=i.nodes)==null?void 0:C.get(h==null?void 0:h.id);if(!!y)return i.selectOnly(y),i.requestSave(),h},M=async(n,i,s,t="default")=>{var g;if(i.readonly||i.selection.size!==1)return;let e=i.selection.entries().next().value[1];if(e.isEditing&&!s)return;let o=n.settings.layout.direction,a=E(o),r=w(a),d=i.getEdgesForNode(e).filter(u=>u.to.node.id===e.id&&u.from.side===a&&u.to.side===r);if(d.length===0)return;let l=d[0].from.node,h=await K(n,i,e,o,!1,t);if(h){let u=B(i,l,o);V(n,i,u,o),i.deselectAll();let y=(g=i.nodes)==null?void 0:g.get(h.id);y&&i.selectOnly(y),i.requestSave()}return h},q=async(n,i,s)=>{if(i.readonly||i.selection.size!==1)return;let t=i.selection.entries().next().value[1];if(t.isEditing&&!s)return;let e=n.settings.layout.direction,o=await K(n,i,t,e,!0),a=B(i,t,e);return V(n,i,a,e),o},A=async(n,i,s)=>{if(i.readonly||i.selection.size!==1)return;let t=i.selection.entries().next().value[1];return t.isEditing?void 0:await K(n,i,t,s,!0)},V=(n,i,s,t)=>{if(!n.settings.layout.autoLayout)return;let e=n.settings.layout.ignoreFilesRegex,o=i.view.file;if(o&&e&&new RegExp(e).test(o.path))return;let a=t==="TB"||t==="BT",r=E(t),d=w(r),l=a?n.settings.create.parentChildGapForVertical:n.settings.create.parentChildGapForHorizontal,h=a?n.settings.create.siblingGapForVertical:n.settings.create.siblingGapForHorizontal,g=n.settings.create.siblingTolerance||10,u=n.settings.create.childNodeWidth?n.settings.create.childNodeWidth:s.width,y=n.settings.create.childNodeHeight?n.settings.create.childNodeHeight:s.height,v=(c,m)=>{if(a){let T=t==="TB"?m.y-c.y:c.y-m.y,x=c.height/2+l+m.height/2;return Math.abs(T-x)<=g}else{let T=t==="LR"?m.x-c.x:c.x-m.x,x=c.width/2+l+m.width/2;return console.log(m.x,c.x,m.x-c.x,x,g,Math.abs(m.x-c.x-x),Math.abs(m.x-c.x-x)<=g),Math.abs(T-x)<=g}},C=c=>{let m=i.getEdgesForNode(c).filter(T=>T.from.node.id===c.id&&T.from.side===r&&T.to.side===d).map(T=>T.to.node).filter(T=>v(c,T)).sort((T,x)=>a?T.x-x.x:T.y-x.y);return console.log(m),{node:c,children:m.map(C),width:c.width,height:c.height,subtreeWidth:0,subtreeHeight:0,x:0,y:0}},b=c=>{if(c.children.length===0){c.subtreeWidth=c.width,c.subtreeHeight=c.height;return}c.children.forEach(b),a?(c.subtreeWidth=Math.max(c.width,c.children.reduce((m,T)=>m+T.subtreeWidth,0)+h*(c.children.length-1)),c.subtreeHeight=c.height+l+Math.max(...c.children.map(m=>m.subtreeHeight))):(c.subtreeWidth=c.width+l+Math.max(...c.children.map(m=>m.subtreeWidth)),c.subtreeHeight=Math.max(c.height,c.children.reduce((m,T)=>m+T.subtreeHeight,0)+h*(c.children.length-1)))},S=(c,m,T,x=!1)=>{var Z,ee;if(x?(c.x=c.node.x,c.y=c.node.y):a?(c.x=m+(c.subtreeWidth-c.width)/2,c.y=T):(c.x=m,c.y=T+(c.subtreeHeight-c.height)/2),a){let I=x?c.x-c.subtreeWidth/2+u/2:m,W=t==="TB"?c.y+c.height+l:c.y-l-(((Z=c.children[0])==null?void 0:Z.subtreeHeight)||0);c.children.forEach(k=>{S(k,I,W),I+=k.subtreeWidth+(c.children.length>1?h:0)})}else{let I=t==="LR"?c.x+c.width+l:c.x-l-(((ee=c.children[0])==null?void 0:ee.subtreeWidth)||0),W=x?c.y-c.subtreeHeight/2+y/2:T;c.children.forEach(k=>{S(k,I,W),W+=k.subtreeHeight+(c.children.length>1?h:0)})}},D=c=>{(c.x!==c.node.x||c.y!==c.node.y)&&c.node.moveTo({x:c.x,y:c.y}),c.children.forEach(D)},N=C(s);return b(N),S(N,s.x,s.y,!0),D(N),N},B=(n,i,s)=>{let t=E(s),e=w(t),o=i;for(;;){let a=n.getEdgesForNode(o).find(r=>r.to.node.id===o.id&&r.from.side===t&&r.to.side===e);if(!a)return o;o=a.from.node}};var G={up:{dx:0,dy:-1},down:{dx:0,dy:1},left:{dx:-1,dy:0},right:{dx:1,dy:0}},O=(n,i)=>{if(!G[i]){console.error(`Invalid direction: ${i}`);return}let s=n.selection;if(s.size!==1)return;let t=s.values().next().value;if(t.isEditing)return;let{x:e,y:o,width:a,height:r}=t,d=n.getViewportNodes();n.deselectAll();let l=e+a/2,h=o+r/2,u=d.filter(C=>C!==t).map(C=>{let b=C.x+C.width/2,S=C.y+C.height/2,D=b-l,N=S-h,c=D*G[i].dx+N*G[i].dy,m=Math.sqrt(D*D+N*N),T=Math.abs(D*G[i].dy-N*G[i].dx),x=-1/0;return c>0&&(x=1/(m*(T+1))),{node:C,score:x,distance:m}}).filter(C=>C.score>-1/0);if(u.length===0)return console.log("No valid nodes found in the specified direction"),null;let v=u.sort((C,b)=>Math.abs(C.score-b.score)<1e-4?C.distance-b.distance:b.score-C.score)[0].node;return v&&(n.selectOnly(v),n.zoomToSelection()),v};var ce=require("obsidian");var le=require("@codemirror/view"),he=n=>le.EditorView.updateListener.of(i=>{if(i.docChanged){let s=i.state.field(ce.editorInfoField);if(s.node){let t=i.view.contentHeight;if(s.node.height===t)return;let e=s.node.width;n.settings.resize.widthAutoResize&&(e=i.view.defaultCharacterWidth*i.view.state.doc.line(1).length+120);let o=s.node.height,a=s.node.width,r=Array.from(s.node.canvas.nodes.values());P({movedNode:s.node,nodes:r},{adjustedHeight:t-o,adjustedWidth:(e>n.settings.resize.maxWidth?s.node.width:e)-a}),s.node.resize({width:e>n.settings.resize.maxWidth?s.node.width:e,height:t+20}),n.debounceSaveCanvas(s.node.canvas,s.node)}}});var $=new Intl.Collator(0,{numeric:1}).compare;function ge(n,i,s){return n=n.split("."),i=i.split("."),$(n[0],i[0])||$(n[1],i[1])||(i[2]=i.slice(2).join("."),s=/[.-]/.test(n[2]=n.slice(2).join(".")),s==/[.-]/.test(i[2])?$(n[2],i[2]):s?-1:1)}var Ne=(n,i)=>{if(n.selection.size!==1)return!1;let s=n.selection.entries().next().value[1];if(s.isEditing)return!1;let t=n.getEdgesForNode(s).filter(l=>l.to.node.id===s.id);if(t.length===0)return!1;let e=t[0].from.node,o=i.settings.layout.direction,a=B(n,e,o),r=ae(n,i,s),d=oe(n,a,o);return{parentNode:e,rootNode:a,direction:o,deletedNode:s,nodeToFocus:r,bbox:d}},we=(n,i,s,t,e,o)=>{V(i,n,s,t),e&&(n.selectOnly(e),n.zoomToSelection()),n.requestSave()},ue=(n,i)=>{!i.scope||(n.settings.create.createFloat&&(i.scope.register(["Mod"],"ArrowUp",()=>{H(n,i.canvas,"top")}),i.scope.register(["Mod"],"ArrowDown",()=>{H(n,i.canvas,"bottom")}),i.scope.register(["Mod"],"ArrowLeft",()=>{H(n,i.canvas,"left")}),i.scope.register(["Mod"],"ArrowRight",()=>{H(n,i.canvas,"right")})),n.settings.create.createCustomChildNode&&(i.scope.register(["Mod","Shift"],"ArrowUp",async()=>{let s=await A(n,i.canvas,"BT");!s||(n.settings.layout.direction="BT",await n.saveSettings(),setTimeout(()=>{var e;let t=(e=i.canvas.nodes)==null?void 0:e.get(s.id);t==null||t.startEditing(),i.canvas.zoomToSelection()},0))}),i.scope.register(["Mod","Shift"],"ArrowDown",async()=>{let s=await A(n,i.canvas,"TB");!s||(n.settings.layout.direction="TB",await n.saveSettings(),setTimeout(()=>{var e;let t=(e=i.canvas.nodes)==null?void 0:e.get(s.id);t==null||t.startEditing(),i.canvas.zoomToSelection()},0))}),i.scope.register(["Mod","Shift"],"ArrowLeft",async()=>{let s=await A(n,i.canvas,"RL");!s||(n.settings.layout.direction="RL",await n.saveSettings(),setTimeout(()=>{var e;let t=(e=i.canvas.nodes)==null?void 0:e.get(s.id);t==null||t.startEditing(),i.canvas.zoomToSelection()},0))}),i.scope.register(["Mod","Shift"],"ArrowRight",async()=>{let s=await A(n,i.canvas,"LR");!s||(n.settings.layout.direction="LR",await n.saveSettings(),setTimeout(()=>{var e;let t=(e=i.canvas.nodes)==null?void 0:e.get(s.id);t==null||t.startEditing(),i.canvas.zoomToSelection()},0))})),n.settings.navigate.useNavigate&&(i.scope.register(["Alt"],"ArrowUp",()=>{O(i.canvas,"up")}),i.scope.register(["Alt"],"ArrowDown",()=>{O(i.canvas,"down")}),i.scope.register(["Alt"],"ArrowLeft",()=>{O(i.canvas,"left")}),i.scope.register(["Alt"],"ArrowRight",()=>{O(i.canvas,"right")})),n.settings.hotkey.hotkeyMode==="Space"?(i.scope.register(["Mod"],"Enter",async()=>{let s=await M(n,i.canvas,!1,"prev");!s||setTimeout(()=>{var e;let t=(e=i.canvas.nodes)==null?void 0:e.get(s.id);t==null||t.startEditing(),i.canvas.zoomToSelection()},0)}),i.scope.register([],"Enter",async()=>{let s=await M(n,i.canvas,!1);!s||setTimeout(()=>{var e;let t=(e=i.canvas.nodes)==null?void 0:e.get(s.id);t==null||t.startEditing(),i.canvas.zoomToSelection()},0)}),i.scope.register([]," ",async s=>{if(i.canvas.readonly)return;let t=i.canvas.selection;if(t.size!==1)return;let e=t.entries().next().value[1];(e==null?void 0:e.label)||(e==null?void 0:e.url)||e.isEditing||e.startEditing()})):(i.scope.register(["Mod","Shift"],"Enter",async()=>{let s=await M(n,i.canvas,!1,"prev");!s||setTimeout(()=>{var e;let t=(e=i.canvas.nodes)==null?void 0:e.get(s.id);t==null||t.startEditing(),i.canvas.zoomToSelection()},0)}),i.scope.register(["Mod"],"Enter",async()=>{let s=await M(n,i.canvas,!1);!s||setTimeout(()=>{var e;let t=(e=i.canvas.nodes)==null?void 0:e.get(s.id);t==null||t.startEditing(),i.canvas.zoomToSelection()},0)}),i.scope.register([],"Enter",async s=>{if(i.canvas.readonly)return;let t=i.canvas.selection;if(t.size!==1)return;let e=t.entries().next().value[1];(e==null?void 0:e.label)||(e==null?void 0:e.url)||e.isEditing||e.startEditing()})),i.scope.register([],"Tab",async s=>{let t=await q(n,i.canvas,!1);!t||setTimeout(()=>{var o;let e=(o=i.canvas.nodes)==null?void 0:o.get(t.id);e==null||e.startEditing(),i.canvas.zoomToSelection()},20)}))},Ee=(n,i)=>{ue(n,i);let s=i.canvas,t=L(i.constructor.prototype,{onOpen:r=>async function(){return ue(n,this),r.call(this)}}),e=L(s.constructor.prototype,{deleteSelection:r=>function(){if(this.selection.size>1)return r.call(this);{let d=Ne(this,n);r.call(this),d&&typeof d=="object"&&we(this,n,d.rootNode,d.direction,d.nodeToFocus,d.bbox)}}}),o=r=>{let d=L(r.constructor.prototype,{setColor:g=>function(u,y){g.call(this,u,y),this.canvas.getEdgesForNode(this).forEach(v=>{v.from.node===this&&(v.setColor(u,!0),v.render())}),s.requestSave()}}),l=Object.getPrototypeOf(r.constructor.prototype),h=L(l,{moveAndResize:g=>function({x:u,y,width:v,height:C}){(this.width!==v||this.height!==C)&&(g.call(this,{x:u,y,width:v,height:C}),n.debounceSaveCanvas(this.canvas,this)),g.call(this,{x:u,y,width:v,height:C})}});n.register(d),n.register(h)},a=L(s.constructor.prototype,{selectOnly:r=>function(d){return d&&(o(d),a()),r.call(this,d)}});n.register(t),n.register(e),n.register(a),console.log("Obsidian-Canvas-MindMap: canvas view patched")},R={TB:{icon:"layout-panel-top",reverse:!1,title:"Top-Bottom"},BT:{icon:"layout-panel-top",reverse:!0,title:"Bottom-Top"},LR:{icon:"layout-panel-left",reverse:!1,title:"Left-Right"},RL:{icon:"layout-panel-left",reverse:!0,title:"Right-Left"}},X=class extends f.Plugin{constructor(){super(...arguments);this.debounceSaveCanvas=(0,f.debounce)((s,t)=>{let e=B(s,t,this.settings.layout.direction);V(this,s,e,this.settings.layout.direction),s.requestSave()},1e3)}async onload(){await this.registerSettings(),this.registerChangelogView(),this.registerCommands(),this.aroundCanvasMethods(this),this.patchMarkdownFileInfo(),this.registerCanvasMenus(),this.registerStatusBar(),this.registerStatusBarEvent(),this.registerEditorExtensions()}onunload(){}async registerSettings(){this.settingTab=new Y(this.app,this),this.addSettingTab(this.settingTab),await this.loadSettings()}registerChangelogView(){this.registerView(z,s=>new J(this.app,s,this)),this.checkForUpdates()}async checkForUpdates(){let s=this.manifest.version,t=this.settings.advanced.lastUpdatedVersion||"0.0.0";ge(s,t)===1&&(this.settings.advanced.lastUpdatedVersion=s,await this.saveSettings(),this.app.workspace.getLeaf("tab").setViewState({type:z}))}registerCommands(){this.addCommand({id:"split-heading-into-mindmap",name:"Split Heading into mindmap based on H1",checkCallback:s=>{var e;let t=this.app.workspace.getActiveViewOfType(f.ItemView);if((t==null?void 0:t.getViewType())==="canvas"){if(!s){let o=t==null?void 0:t.canvas,a=o==null?void 0:o.selection;if(a.size>1)return!1;let r=a.values().next().value;if(!r.filePath)return!1;let d=r.file;if(d.extension!=="md")return!1;let l=(e=this.app.metadataCache.getFileCache(d))==null?void 0:e.headings;if(!l)return!1;let h=l.filter(v=>v.level===1);if(h.length===0)return!1;let g=(r.height*.6+20)*h.length,u=-1,y=r.y+r.height/2+g/2*u;h.forEach((v,C)=>{te(o,r,d,"#"+v.heading,y-u*(r.height*.6+20)*C)})}return!0}}}),this.addCommand({id:"create-floating-node",name:"Create floating node",checkCallback:s=>{let t=this.app.workspace.getActiveViewOfType(f.ItemView);if((t==null?void 0:t.getViewType())==="canvas"){if(!s){let e=t==null?void 0:t.canvas,o=e.createTextNode({pos:{x:0,y:0,height:500,width:400},size:{x:0,y:0,height:500,width:400},text:"",focus:!0,save:!0});if(e.addNode(o),e.requestSave(),!o)return;setTimeout(()=>{o.startEditing(),e.zoomToSelection()},0)}return!0}}}),this.addCommand({id:"create-child-node",name:"Create child node",checkCallback:s=>{let t=this.app.workspace.getActiveViewOfType(f.ItemView);if((t==null?void 0:t.getViewType())==="canvas"){if(!s){let e=t==null?void 0:t.canvas;q(this,e,!0).then(o=>{!o||setTimeout(()=>{var r;let a=(r=e.nodes)==null?void 0:r.get(o.id);e.zoomToSelection(),a==null||a.startEditing()},0)})}return!0}}}),this.addCommand({id:"create-next-sibling-node",name:"Create next sibling node",checkCallback:s=>{let t=this.app.workspace.getActiveViewOfType(f.ItemView);if((t==null?void 0:t.getViewType())==="canvas"){let e=t==null?void 0:t.canvas;if(e.selection.size!==1)return!1;let o=e.selection.entries().next().value[1],a=B(e,o,this.settings.layout.direction);return a&&a.id===o.id||!a?(new f.Notice("You can only create sibling node for non-root node"),!1):(s||M(this,e,!0,"default").then(r=>{!r||setTimeout(()=>{var l;let d=(l=e.nodes)==null?void 0:l.get(r.id);e.zoomToSelection(),d==null||d.startEditing()},0)}),!0)}}}),this.addCommand({id:"create-previous-sibling-node",name:"Create previous sibling node",checkCallback:s=>{let t=this.app.workspace.getActiveViewOfType(f.ItemView);if((t==null?void 0:t.getViewType())==="canvas"){if(!s){let e=t==null?void 0:t.canvas;if(e.selection.size!==1)return!1;let o=e.selection.entries().next().value[1],a=B(e,o,this.settings.layout.direction);if(a&&a.id===o.id||!a)return new f.Notice("You can only create sibling node for non-root node"),!1;M(this,e,!0,"prev").then(r=>{!r||setTimeout(()=>{var l;let d=(l=e.nodes)==null?void 0:l.get(r.id);e.zoomToSelection(),d==null||d.startEditing()},0)})}return!0}}}),this.addCommand({id:"enter-edit-mode",name:"Enter edit mode",callback:()=>{let s=this.app.workspace.getActiveViewOfType(f.ItemView);if((s==null?void 0:s.getViewType())==="canvas"){let t=s==null?void 0:s.canvas;if(t.selection.size!==1)return;t.selection.entries().next().value[1].startEditing()}}}),this.addCommand({id:"exit-edit-mode",name:"Exit edit mode",callback:()=>{let s=this.app.workspace.getActiveViewOfType(f.ItemView);if((s==null?void 0:s.getViewType())==="canvas"){let t=s==null?void 0:s.canvas;if(t.selection.size!==1)return;let e=t.selection.entries().next().value[1];e.setIsEditing(!1),e.canvas.wrapperEl.focus(),t.requestSave()}}}),this.addCommand({id:"change-direction",name:"Change direction",callback:()=>{new Q(this).open()}}),this.addCommand({id:"open-changelog",name:"Open changelog",callback:()=>{this.app.workspace.getLeavesOfType(z).length>0?this.app.workspace.getLeavesOfType(z)[0].rebuildView():this.app.workspace.getLeaf().setViewState({type:z})}})}aroundCanvasMethods(s){let t=L(f.WorkspaceLeaf.prototype,{setViewState(e){return function(o,...a){var r,d,l;return(r=o.state)!=null&&r.file&&((d=o.state)==null?void 0:d.file)&&((l=o.state)==null?void 0:l.file).endsWith(".canvas")&&setTimeout(()=>{this.view.canvas&&(Ee(s,this.view),t())},400),e.apply(this,[o,...a])}}});this.register(t)}registerCanvasMenus(){this.registerEvent(this.app.workspace.on("canvas:node-menu",(s,t)=>{if(t.canvas.readonly)return;let e=t.canvas;s.addItem(a=>{a.setSection("canvas").setIcon("layout-panel-top").setTitle("Create child node").onClick(()=>{q(this,e,!0).then(r=>{!r||setTimeout(()=>{var l;let d=(l=e.nodes)==null?void 0:l.get(r.id);d==null||d.startEditing(),e.zoomToSelection()},0)})})});let o=B(e,t,this.settings.layout.direction);o&&o.id!==t.id&&(s.addItem(a=>{a.setSection("canvas").setIcon("layout-panel-left").setTitle("Create next sibling node").onClick(()=>{M(this,e,!0,"next").then(r=>{!r||setTimeout(()=>{var l;let d=(l=e.nodes)==null?void 0:l.get(r.id);d==null||d.startEditing(),e.zoomToSelection()},0)})})}),s.addItem(a=>{a.setSection("canvas").setIcon("layout-panel-left").setTitle("Create previous sibling node").onClick(()=>{M(this,e,!0,"prev").then(r=>{!r||setTimeout(()=>{var l;let d=(l=e.nodes)==null?void 0:l.get(r.id);d==null||d.startEditing(),e.zoomToSelection()},0)})})})),se(e,t,this.settings.layout.direction)&&(s.addSeparator(),s.addItem(a=>{a.setSection("canvas").setIcon("lasso-select").setTitle("Select tree").onClick(()=>{ne(e,t,this.settings.layout.direction)})}))}))}registerStatusBar(){var s,t;this.statusBar?(s=this.statusBar)==null||s.empty():this.statusBar=this.addStatusBarItem(),(t=this.statusBar)==null||t.toggleClass("mind-map-status-bar",!0),this.statusBar.createSpan({cls:"text-container"}).setText("Canvas mindmap: "),this.statusBar.createSpan({cls:"icon-container"},e=>{(0,f.setIcon)(e,R[this.settings.layout.direction].icon),e.toggleClass("reverse",R[this.settings.layout.direction].reverse)}),(0,f.setTooltip)(this.statusBar,"Current direction: "+R[this.settings.layout.direction].title)}registerStatusBarEvent(){this.registerDomEvent(this.statusBar,"click",s=>{let t=new f.Menu;Object.entries(R).forEach(([e,o])=>{t.addItem(a=>{a.setChecked(this.settings.layout.direction===e).setDisabled(this.settings.layout.direction===e).setIcon(o.icon).setTitle(o.title).onClick(()=>{this.settings.layout.direction=e,this.saveSettings(),this.registerStatusBar()}),a.iconEl&&a.iconEl.toggleClass("reverse",o.reverse)})}),t.showAtPosition({x:s.clientX,y:s.clientY})})}registerEditorExtensions(){let s=this.app.plugins.getPlugin("node-auto-resize");!this.settings.resize.autoResize||s||this.registerEditorExtension([he(this)])}patchMarkdownFileInfo(){let s=()=>{let t=this.app.workspace.activeEditor;if(!t||!t.node||!t||!t.containerEl||t.containerEl.closest(".common-editor-inputer"))return!1;let e=t.constructor,o=L(e.prototype,{showPreview:a=>function(r){var l,h;let d=a.call(this,r);return r&&((l=this.node)==null||l.canvas.wrapperEl.focus(),(h=this.node)==null||h.setIsEditing(!1)),d}});return this.register(o),console.log("Obsidian-Canvas-MindMap: markdown file info patched"),!0};this.app.workspace.onLayoutReady(()=>{if(!s()){let t=this.app.workspace.on("file-open",()=>{setTimeout(()=>{s()&&this.app.workspace.offref(t)},100)});this.registerEvent(t)}})}async loadSettings(){this.settings=Object.assign({},re,await this.loadData())}async saveSettings(){await this.saveData(this.settings),this.registerStatusBar()}},Q=class extends f.SuggestModal{constructor(s){super(s.app);this.plugin=s}getSuggestions(){return Object.keys(R)}getItemText(s){return R[s].title}renderSuggestion(s,t){t.createSpan({cls:"icon-container"},e=>{(0,f.setIcon)(e,R[s].icon),e.toggleClass("reverse",R[s].reverse)}),t.createSpan({cls:"text-container"}).setText(this.getItemText(s))}async onChooseSuggestion(s,t){this.plugin.settings.layout.direction=s,this.plugin.saveSettings(),this.plugin.registerStatusBar()}},z="cm-changelog-view",J=class extends f.ItemView{constructor(s,t,e){super(t);this.plugin=e,this.app=s,this.leaf=t}getViewType(){return z}getDisplayText(){return"Changelog of Canvas Mindmap"}getIcon(){return"rocket"}async onOpen(){this.contentEl.toggleClass(["changelog-content"],!0),this.contentEl.setText("Loading changelog..."),this.titleEl.setText("Canvas Mindmap v"+this.plugin.manifest.version);try{let t=await(0,f.requestUrl)({url:"https://raw.githubusercontent.com/quorafind/Obsidian-Canvas-MindMap/master/CHANGELOG.md",method:"GET"});if(t.status===200){let e=t.text,o=this.extractLatestChangelog(e);this.contentEl.empty(),await f.MarkdownRenderer.render(this.app,o,this.contentEl,"",this),await this.plugin.saveSettings()}else throw new Error(`Failed to fetch changelog: ${t.status}`)}catch(s){console.error("Error fetching changelog:",s),this.contentEl.setText("Failed to load changelog. Please try again later.")}}async onClose(){this.containerEl.empty()}extractLatestChangelog(s){let t=s.split(/^# /m);return t.length>1?"## "+t[1].trim():s}};
|
|
7
|
+
|
|
8
|
+
/* nosourcemap */
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "canvas-mindmap",
|
|
3
|
+
"name": "Canvas Mindmap",
|
|
4
|
+
"version": "1.0.2",
|
|
5
|
+
"minAppVersion": "1.4.0",
|
|
6
|
+
"description": "A plugin to make your canvas work like a mindmap.",
|
|
7
|
+
"author": "Boninall",
|
|
8
|
+
"authorUrl": "https://github.com/quorafind",
|
|
9
|
+
"fundingUrl": {
|
|
10
|
+
"Buy Me a Coffee": "https://www.buymeacoffee.com/boninall",
|
|
11
|
+
"爱发电": "https://afdian.net/a/boninall",
|
|
12
|
+
"支付宝": "https://cdn.jsdelivr.net/gh/Quorafind/.github@main/IMAGE/%E6%94%AF%E4%BB%98%E5%AE%9D%E4%BB%98%E6%AC%BE%E7%A0%81.jpg"
|
|
13
|
+
},
|
|
14
|
+
"isDesktopOnly": false
|
|
15
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.mind-map-setting-desc {
|
|
2
|
+
margin-top: var(--size-4-2);
|
|
3
|
+
margin-bottom: var(--size-4-2);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.mind-map-demo {
|
|
7
|
+
text-align: center;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.menu-item-icon.reverse {
|
|
11
|
+
transform: rotate(180deg);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.mind-map-status-bar.status-bar-item .icon-container.reverse {
|
|
15
|
+
transform: rotate(180deg);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.mind-map-status-bar.status-bar-item:hover {
|
|
19
|
+
background-color: var(--background-modifier-hover);
|
|
20
|
+
color: var(--text-normal);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.mind-map-status-bar.status-bar-item .svg-icon {
|
|
24
|
+
--icon-size: 14px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.mind-map-status-bar.status-bar-item .icon-container {
|
|
28
|
+
margin-left: var(--size-2-2);
|
|
29
|
+
}
|