service-flow-designer 0.0.1-beta.0 → 0.0.1-beta.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/es/designer/common/components/json-view/json-view-dialog.vue.js +1 -1
- package/dist/es/designer/common/components/json-view/json-view.vue.js +1 -179
- package/dist/es/designer/common/components/json-view/json-view.vue2.js +179 -1
- package/dist/es/designer/service-flow-view/service-test/service-test.vue.js +1 -1
- package/dist/lib/designer/common/components/json-view/json-view-dialog.vue.js +1 -1
- package/dist/lib/designer/common/components/json-view/json-view.vue.js +2 -180
- package/dist/lib/designer/common/components/json-view/json-view.vue2.js +180 -2
- package/dist/lib/designer/service-flow-view/service-test/service-test.vue.js +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, resolveComponent, openBlock, createBlock, withCtx, createVNode } from "vue";
|
|
2
|
-
import _sfc_main$1 from "./json-view.
|
|
2
|
+
import _sfc_main$1 from "./json-view.vue2.js";
|
|
3
3
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
4
|
...{
|
|
5
5
|
name: "JsonViewDialog",
|
|
@@ -1,182 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { basicSetup } from "../../../../node_modules/.pnpm/codemirror@6.0.1_@lezer_common@1.2.1/node_modules/codemirror/dist/index.js";
|
|
3
|
-
import { jsonLanguage } from "../../../../node_modules/.pnpm/@codemirror_lang-json@6.0.1/node_modules/@codemirror/lang-json/dist/index.js";
|
|
4
|
-
import { EditorState, Facet } from "../../../../node_modules/.pnpm/@codemirror_state@6.4.1/node_modules/@codemirror/state/dist/index.js";
|
|
5
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-abcdef@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abcdef/esm/index.js";
|
|
6
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-abyss@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abyss/esm/index.js";
|
|
7
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-androidstudio@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-androidstudio/esm/index.js";
|
|
8
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-andromeda@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-andromeda/esm/index.js";
|
|
9
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-atomone@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-atomone/esm/index.js";
|
|
10
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-aura@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-aura/esm/index.js";
|
|
11
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-basic@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-basic/esm/dark.js";
|
|
12
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-basic@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-basic/esm/light.js";
|
|
13
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-bbedit@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-bbedit/esm/index.js";
|
|
14
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-bespin@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-bespin/esm/index.js";
|
|
15
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-console@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-console/esm/dark.js";
|
|
16
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-console@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-console/esm/light.js";
|
|
17
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-copilot@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-copilot/esm/index.js";
|
|
18
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-darcula@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-darcula/esm/index.js";
|
|
19
|
-
import { dracula } from "../../../../node_modules/.pnpm/@uiw_codemirror-theme-dracula@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-dracula/esm/index.js";
|
|
20
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-duotone@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-duotone/esm/index.js";
|
|
21
|
-
import { eclipse } from "../../../../node_modules/.pnpm/@uiw_codemirror-theme-eclipse@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-eclipse/esm/index.js";
|
|
22
|
-
import { githubDark, githubLight } from "../../../../node_modules/.pnpm/@uiw_codemirror-theme-github@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-github/esm/index.js";
|
|
23
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-gruvbox-dark@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-gruvbox-dark/esm/index.js";
|
|
24
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-kimbie@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-kimbie/esm/index.js";
|
|
25
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-material@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-material/esm/index.js";
|
|
26
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-monokai@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-monokai/esm/index.js";
|
|
27
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-monokai-dimmed@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-monokai-dimmed/esm/index.js";
|
|
28
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-noctis-lilac@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-noctis-lilac/esm/index.js";
|
|
29
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-nord@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-nord/esm/index.js";
|
|
30
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-okaidia@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-okaidia/esm/index.js";
|
|
31
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-quietlight@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-quietlight/esm/index.js";
|
|
32
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-red@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-red/esm/index.js";
|
|
33
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-solarized@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-solarized/esm/dark.js";
|
|
34
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-solarized@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-solarized/esm/light.js";
|
|
35
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-sublime@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-sublime/esm/index.js";
|
|
36
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-tokyo-night/esm/index.js";
|
|
37
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night-storm@4.22.2_@codemirror_language@6.10.2_@codemirror_state@_sg5tsucubbfkilam6qx2r2u7r4/node_modules/@uiw/codemirror-theme-tokyo-night-storm/esm/index.js";
|
|
38
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night-day@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-tokyo-night-day/esm/index.js";
|
|
39
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-tomorrow-night-blue@4.22.2_@codemirror_language@6.10.2_@codemirror_stat_4uqjswejhb57pqfwybv25yl5gi/node_modules/@uiw/codemirror-theme-tomorrow-night-blue/esm/index.js";
|
|
40
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-vscode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-vscode/esm/light.js";
|
|
41
|
-
import { vscodeDark } from "../../../../node_modules/.pnpm/@uiw_codemirror-theme-vscode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-vscode/esm/dark.js";
|
|
42
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-white@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-white/esm/dark.js";
|
|
43
|
-
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-white@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-white/esm/light.js";
|
|
44
|
-
import { xcodeDark, xcodeLight } from "../../../../node_modules/.pnpm/@uiw_codemirror-theme-xcode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-xcode/esm/index.js";
|
|
45
|
-
import { EditorView } from "../../../../node_modules/.pnpm/@codemirror_view@6.28.1/node_modules/@codemirror/view/dist/index.js";
|
|
46
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
47
|
-
...{
|
|
48
|
-
name: "JsonView",
|
|
49
|
-
inheritAttrs: false
|
|
50
|
-
},
|
|
51
|
-
__name: "json-view",
|
|
52
|
-
props: {
|
|
53
|
-
jsonObject: {
|
|
54
|
-
type: Object,
|
|
55
|
-
default: () => {
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
height: {
|
|
59
|
-
type: Number,
|
|
60
|
-
default: 0
|
|
61
|
-
},
|
|
62
|
-
theme: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: null
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
setup(__props) {
|
|
68
|
-
const props = __props;
|
|
69
|
-
const editor = ref(null);
|
|
70
|
-
const cfCodemirrorJsonViewRef = ref();
|
|
71
|
-
const codemirrorHeight = ref("400px");
|
|
72
|
-
watch(
|
|
73
|
-
() => props.jsonObject,
|
|
74
|
-
(newVal) => {
|
|
75
|
-
if (editor.value) {
|
|
76
|
-
loadEditor();
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
{ deep: true }
|
|
80
|
-
);
|
|
81
|
-
onMounted(() => {
|
|
82
|
-
nextTick(() => {
|
|
83
|
-
loadEditor();
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
function loadEditor() {
|
|
87
|
-
if (editor.value) {
|
|
88
|
-
editor.value.destroy();
|
|
89
|
-
}
|
|
90
|
-
const jsonStr = props.jsonObject ? JSON.stringify(props.jsonObject, null, 2) : "";
|
|
91
|
-
if (props.height) {
|
|
92
|
-
codemirrorHeight.value = props.height + "px";
|
|
93
|
-
} else {
|
|
94
|
-
if (cfCodemirrorJsonViewRef.value) {
|
|
95
|
-
const rect = cfCodemirrorJsonViewRef.value.getBoundingClientRect();
|
|
96
|
-
if (rect.y || rect.y === 0) {
|
|
97
|
-
console.log("window.innerHeight - rect.y", window.innerHeight, rect.y);
|
|
98
|
-
codemirrorHeight.value = window.innerHeight - rect.y - 100 + "px";
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
const state = getEditorState(jsonStr);
|
|
103
|
-
let element = document.getElementById("cf-codemirror-view-json");
|
|
104
|
-
if (element) {
|
|
105
|
-
editor.value = new EditorView({
|
|
106
|
-
state,
|
|
107
|
-
parent: element
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
function getEditorState(jsonStr) {
|
|
112
|
-
const mytheme = getTheme();
|
|
113
|
-
const baseTheme = EditorView.theme({
|
|
114
|
-
".cm-content, .cm-gutter": { minHeight: codemirrorHeight.value },
|
|
115
|
-
"&": {
|
|
116
|
-
height: codemirrorHeight.value,
|
|
117
|
-
maxHeight: codemirrorHeight.value,
|
|
118
|
-
fontSize: "12px"
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
return EditorState.create({
|
|
122
|
-
doc: jsonStr,
|
|
123
|
-
extensions: [
|
|
124
|
-
EditorState.tabSize.of(16),
|
|
125
|
-
basicSetup,
|
|
126
|
-
jsonLanguage,
|
|
127
|
-
mytheme,
|
|
128
|
-
baseTheme,
|
|
129
|
-
readOnlyFacet.of(true),
|
|
130
|
-
preventChanges
|
|
131
|
-
]
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
const readOnlyFacet = Facet.define({ combine: (values) => values.some((a) => a) });
|
|
135
|
-
const preventChanges = EditorState.transactionFilter.of((tr) => {
|
|
136
|
-
if (tr.isUserEvent && tr.docChanged && tr.state.facet(readOnlyFacet)) {
|
|
137
|
-
return {
|
|
138
|
-
changes: {
|
|
139
|
-
from: tr.changes.from,
|
|
140
|
-
to: tr.changes.to,
|
|
141
|
-
insert: tr.startState.doc.sliceString(tr.changes.from, tr.changes.to)
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
return tr;
|
|
146
|
-
});
|
|
147
|
-
function getTheme() {
|
|
148
|
-
if (props.theme) {
|
|
149
|
-
switch (props.theme) {
|
|
150
|
-
case "xcodeLight":
|
|
151
|
-
return xcodeLight;
|
|
152
|
-
case "xcodeDark":
|
|
153
|
-
return xcodeDark;
|
|
154
|
-
case "vscodeDark":
|
|
155
|
-
return vscodeDark;
|
|
156
|
-
case "dracula":
|
|
157
|
-
return dracula;
|
|
158
|
-
case "githubLight":
|
|
159
|
-
return githubLight;
|
|
160
|
-
case "githubDark":
|
|
161
|
-
return githubDark;
|
|
162
|
-
case "eclipse":
|
|
163
|
-
return eclipse;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
return EditorView.theme({});
|
|
167
|
-
}
|
|
168
|
-
return (_ctx, _cache) => {
|
|
169
|
-
return openBlock(), createElementBlock("div", {
|
|
170
|
-
style: {
|
|
171
|
-
width: "100%"
|
|
172
|
-
},
|
|
173
|
-
ref_key: "cfCodemirrorJsonViewRef",
|
|
174
|
-
ref: cfCodemirrorJsonViewRef,
|
|
175
|
-
id: "cf-codemirror-view-json"
|
|
176
|
-
}, null, 512);
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
});
|
|
1
|
+
import _sfc_main from "./json-view.vue2.js";
|
|
180
2
|
export {
|
|
181
3
|
_sfc_main as default
|
|
182
4
|
};
|
|
@@ -1,4 +1,182 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent, ref, watch, onMounted, nextTick, openBlock, createElementBlock } from "vue";
|
|
2
|
+
import { basicSetup } from "../../../../node_modules/.pnpm/codemirror@6.0.1_@lezer_common@1.2.1/node_modules/codemirror/dist/index.js";
|
|
3
|
+
import { jsonLanguage } from "../../../../node_modules/.pnpm/@codemirror_lang-json@6.0.1/node_modules/@codemirror/lang-json/dist/index.js";
|
|
4
|
+
import { EditorState, Facet } from "../../../../node_modules/.pnpm/@codemirror_state@6.4.1/node_modules/@codemirror/state/dist/index.js";
|
|
5
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-abcdef@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abcdef/esm/index.js";
|
|
6
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-abyss@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abyss/esm/index.js";
|
|
7
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-androidstudio@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-androidstudio/esm/index.js";
|
|
8
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-andromeda@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-andromeda/esm/index.js";
|
|
9
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-atomone@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-atomone/esm/index.js";
|
|
10
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-aura@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-aura/esm/index.js";
|
|
11
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-basic@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-basic/esm/dark.js";
|
|
12
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-basic@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-basic/esm/light.js";
|
|
13
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-bbedit@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-bbedit/esm/index.js";
|
|
14
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-bespin@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-bespin/esm/index.js";
|
|
15
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-console@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-console/esm/dark.js";
|
|
16
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-console@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-console/esm/light.js";
|
|
17
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-copilot@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-copilot/esm/index.js";
|
|
18
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-darcula@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-darcula/esm/index.js";
|
|
19
|
+
import { dracula } from "../../../../node_modules/.pnpm/@uiw_codemirror-theme-dracula@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-dracula/esm/index.js";
|
|
20
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-duotone@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-duotone/esm/index.js";
|
|
21
|
+
import { eclipse } from "../../../../node_modules/.pnpm/@uiw_codemirror-theme-eclipse@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-eclipse/esm/index.js";
|
|
22
|
+
import { githubDark, githubLight } from "../../../../node_modules/.pnpm/@uiw_codemirror-theme-github@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-github/esm/index.js";
|
|
23
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-gruvbox-dark@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-gruvbox-dark/esm/index.js";
|
|
24
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-kimbie@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-kimbie/esm/index.js";
|
|
25
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-material@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-material/esm/index.js";
|
|
26
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-monokai@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-monokai/esm/index.js";
|
|
27
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-monokai-dimmed@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-monokai-dimmed/esm/index.js";
|
|
28
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-noctis-lilac@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-noctis-lilac/esm/index.js";
|
|
29
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-nord@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-nord/esm/index.js";
|
|
30
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-okaidia@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-okaidia/esm/index.js";
|
|
31
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-quietlight@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-quietlight/esm/index.js";
|
|
32
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-red@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-red/esm/index.js";
|
|
33
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-solarized@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-solarized/esm/dark.js";
|
|
34
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-solarized@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-solarized/esm/light.js";
|
|
35
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-sublime@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-sublime/esm/index.js";
|
|
36
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-tokyo-night/esm/index.js";
|
|
37
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night-storm@4.22.2_@codemirror_language@6.10.2_@codemirror_state@_sg5tsucubbfkilam6qx2r2u7r4/node_modules/@uiw/codemirror-theme-tokyo-night-storm/esm/index.js";
|
|
38
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night-day@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-tokyo-night-day/esm/index.js";
|
|
39
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-tomorrow-night-blue@4.22.2_@codemirror_language@6.10.2_@codemirror_stat_4uqjswejhb57pqfwybv25yl5gi/node_modules/@uiw/codemirror-theme-tomorrow-night-blue/esm/index.js";
|
|
40
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-vscode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-vscode/esm/light.js";
|
|
41
|
+
import { vscodeDark } from "../../../../node_modules/.pnpm/@uiw_codemirror-theme-vscode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-vscode/esm/dark.js";
|
|
42
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-white@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-white/esm/dark.js";
|
|
43
|
+
import "../../../../node_modules/.pnpm/@uiw_codemirror-theme-white@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-white/esm/light.js";
|
|
44
|
+
import { xcodeDark, xcodeLight } from "../../../../node_modules/.pnpm/@uiw_codemirror-theme-xcode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-xcode/esm/index.js";
|
|
45
|
+
import { EditorView } from "../../../../node_modules/.pnpm/@codemirror_view@6.28.1/node_modules/@codemirror/view/dist/index.js";
|
|
46
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
47
|
+
...{
|
|
48
|
+
name: "JsonView",
|
|
49
|
+
inheritAttrs: false
|
|
50
|
+
},
|
|
51
|
+
__name: "json-view",
|
|
52
|
+
props: {
|
|
53
|
+
jsonObject: {
|
|
54
|
+
type: Object,
|
|
55
|
+
default: () => {
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
height: {
|
|
59
|
+
type: Number,
|
|
60
|
+
default: 0
|
|
61
|
+
},
|
|
62
|
+
theme: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: null
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
setup(__props) {
|
|
68
|
+
const props = __props;
|
|
69
|
+
const editor = ref(null);
|
|
70
|
+
const cfCodemirrorJsonViewRef = ref();
|
|
71
|
+
const codemirrorHeight = ref("400px");
|
|
72
|
+
watch(
|
|
73
|
+
() => props.jsonObject,
|
|
74
|
+
(newVal) => {
|
|
75
|
+
if (editor.value) {
|
|
76
|
+
loadEditor();
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{ deep: true }
|
|
80
|
+
);
|
|
81
|
+
onMounted(() => {
|
|
82
|
+
nextTick(() => {
|
|
83
|
+
loadEditor();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
function loadEditor() {
|
|
87
|
+
if (editor.value) {
|
|
88
|
+
editor.value.destroy();
|
|
89
|
+
}
|
|
90
|
+
const jsonStr = props.jsonObject ? JSON.stringify(props.jsonObject, null, 2) : "";
|
|
91
|
+
if (props.height) {
|
|
92
|
+
codemirrorHeight.value = props.height + "px";
|
|
93
|
+
} else {
|
|
94
|
+
if (cfCodemirrorJsonViewRef.value) {
|
|
95
|
+
const rect = cfCodemirrorJsonViewRef.value.getBoundingClientRect();
|
|
96
|
+
if (rect.y || rect.y === 0) {
|
|
97
|
+
console.log("window.innerHeight - rect.y", window.innerHeight, rect.y);
|
|
98
|
+
codemirrorHeight.value = window.innerHeight - rect.y - 100 + "px";
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const state = getEditorState(jsonStr);
|
|
103
|
+
let element = document.getElementById("cf-codemirror-view-json");
|
|
104
|
+
if (element) {
|
|
105
|
+
editor.value = new EditorView({
|
|
106
|
+
state,
|
|
107
|
+
parent: element
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function getEditorState(jsonStr) {
|
|
112
|
+
const mytheme = getTheme();
|
|
113
|
+
const baseTheme = EditorView.theme({
|
|
114
|
+
".cm-content, .cm-gutter": { minHeight: codemirrorHeight.value },
|
|
115
|
+
"&": {
|
|
116
|
+
height: codemirrorHeight.value,
|
|
117
|
+
maxHeight: codemirrorHeight.value,
|
|
118
|
+
fontSize: "12px"
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
return EditorState.create({
|
|
122
|
+
doc: jsonStr,
|
|
123
|
+
extensions: [
|
|
124
|
+
EditorState.tabSize.of(16),
|
|
125
|
+
basicSetup,
|
|
126
|
+
jsonLanguage,
|
|
127
|
+
mytheme,
|
|
128
|
+
baseTheme,
|
|
129
|
+
readOnlyFacet.of(true),
|
|
130
|
+
preventChanges
|
|
131
|
+
]
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
const readOnlyFacet = Facet.define({ combine: (values) => values.some((a) => a) });
|
|
135
|
+
const preventChanges = EditorState.transactionFilter.of((tr) => {
|
|
136
|
+
if (tr.isUserEvent && tr.docChanged && tr.state.facet(readOnlyFacet)) {
|
|
137
|
+
return {
|
|
138
|
+
changes: {
|
|
139
|
+
from: tr.changes.from,
|
|
140
|
+
to: tr.changes.to,
|
|
141
|
+
insert: tr.startState.doc.sliceString(tr.changes.from, tr.changes.to)
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return tr;
|
|
146
|
+
});
|
|
147
|
+
function getTheme() {
|
|
148
|
+
if (props.theme) {
|
|
149
|
+
switch (props.theme) {
|
|
150
|
+
case "xcodeLight":
|
|
151
|
+
return xcodeLight;
|
|
152
|
+
case "xcodeDark":
|
|
153
|
+
return xcodeDark;
|
|
154
|
+
case "vscodeDark":
|
|
155
|
+
return vscodeDark;
|
|
156
|
+
case "dracula":
|
|
157
|
+
return dracula;
|
|
158
|
+
case "githubLight":
|
|
159
|
+
return githubLight;
|
|
160
|
+
case "githubDark":
|
|
161
|
+
return githubDark;
|
|
162
|
+
case "eclipse":
|
|
163
|
+
return eclipse;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return EditorView.theme({});
|
|
167
|
+
}
|
|
168
|
+
return (_ctx, _cache) => {
|
|
169
|
+
return openBlock(), createElementBlock("div", {
|
|
170
|
+
style: {
|
|
171
|
+
width: "100%"
|
|
172
|
+
},
|
|
173
|
+
ref_key: "cfCodemirrorJsonViewRef",
|
|
174
|
+
ref: cfCodemirrorJsonViewRef,
|
|
175
|
+
id: "cf-codemirror-view-json"
|
|
176
|
+
}, null, 512);
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
});
|
|
2
180
|
export {
|
|
3
181
|
_sfc_main as default
|
|
4
182
|
};
|
|
@@ -4,7 +4,7 @@ import { json } from "../../../node_modules/.pnpm/@codemirror_lang-json@6.0.1/no
|
|
|
4
4
|
import { EditorState } from "../../../node_modules/.pnpm/@codemirror_state@6.4.1/node_modules/@codemirror/state/dist/index.js";
|
|
5
5
|
import service from "../../../node_modules/.pnpm/agilebuilder-ui@1.0.13_vue@3.4.21/node_modules/agilebuilder-ui/src/utils/request.js";
|
|
6
6
|
import LogicFlow from "../../../node_modules/.pnpm/@logicflow_core@1.2.27/node_modules/@logicflow/core/dist/logic-flow.js";
|
|
7
|
-
import _sfc_main$2 from "../../common/components/json-view/json-view.
|
|
7
|
+
import _sfc_main$2 from "../../common/components/json-view/json-view.vue2.js";
|
|
8
8
|
import "../../../node_modules/.pnpm/@uiw_codemirror-theme-abcdef@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abcdef/esm/index.js";
|
|
9
9
|
import "../../../node_modules/.pnpm/@uiw_codemirror-theme-abyss@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abyss/esm/index.js";
|
|
10
10
|
import "../../../node_modules/.pnpm/@uiw_codemirror-theme-androidstudio@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-androidstudio/esm/index.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const Vue = require("vue");
|
|
3
|
-
const jsonView_vue_vue_type_script_setup_true_lang = require("./json-view.
|
|
3
|
+
const jsonView_vue_vue_type_script_setup_true_lang = require("./json-view.vue2.js");
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
|
|
5
5
|
...{
|
|
6
6
|
name: "JsonViewDialog",
|
|
@@ -1,181 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
const index$3 = require("../../../../node_modules/.pnpm/@codemirror_lang-json@6.0.1/node_modules/@codemirror/lang-json/dist/index.js");
|
|
5
|
-
const index$1 = require("../../../../node_modules/.pnpm/@codemirror_state@6.4.1/node_modules/@codemirror/state/dist/index.js");
|
|
6
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-abcdef@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abcdef/esm/index.js");
|
|
7
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-abyss@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abyss/esm/index.js");
|
|
8
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-androidstudio@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-androidstudio/esm/index.js");
|
|
9
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-andromeda@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-andromeda/esm/index.js");
|
|
10
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-atomone@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-atomone/esm/index.js");
|
|
11
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-aura@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-aura/esm/index.js");
|
|
12
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-basic@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-basic/esm/dark.js");
|
|
13
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-basic@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-basic/esm/light.js");
|
|
14
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-bbedit@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-bbedit/esm/index.js");
|
|
15
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-bespin@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-bespin/esm/index.js");
|
|
16
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-console@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-console/esm/dark.js");
|
|
17
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-console@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-console/esm/light.js");
|
|
18
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-copilot@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-copilot/esm/index.js");
|
|
19
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-darcula@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-darcula/esm/index.js");
|
|
20
|
-
const index$6 = require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-dracula@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-dracula/esm/index.js");
|
|
21
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-duotone@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-duotone/esm/index.js");
|
|
22
|
-
const index$4 = require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-eclipse@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-eclipse/esm/index.js");
|
|
23
|
-
const index$5 = require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-github@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-github/esm/index.js");
|
|
24
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-gruvbox-dark@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-gruvbox-dark/esm/index.js");
|
|
25
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-kimbie@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-kimbie/esm/index.js");
|
|
26
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-material@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-material/esm/index.js");
|
|
27
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-monokai@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-monokai/esm/index.js");
|
|
28
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-monokai-dimmed@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-monokai-dimmed/esm/index.js");
|
|
29
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-noctis-lilac@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-noctis-lilac/esm/index.js");
|
|
30
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-nord@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-nord/esm/index.js");
|
|
31
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-okaidia@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-okaidia/esm/index.js");
|
|
32
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-quietlight@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-quietlight/esm/index.js");
|
|
33
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-red@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-red/esm/index.js");
|
|
34
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-solarized@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-solarized/esm/dark.js");
|
|
35
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-solarized@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-solarized/esm/light.js");
|
|
36
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-sublime@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-sublime/esm/index.js");
|
|
37
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-tokyo-night/esm/index.js");
|
|
38
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night-storm@4.22.2_@codemirror_language@6.10.2_@codemirror_state@_sg5tsucubbfkilam6qx2r2u7r4/node_modules/@uiw/codemirror-theme-tokyo-night-storm/esm/index.js");
|
|
39
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night-day@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-tokyo-night-day/esm/index.js");
|
|
40
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-tomorrow-night-blue@4.22.2_@codemirror_language@6.10.2_@codemirror_stat_4uqjswejhb57pqfwybv25yl5gi/node_modules/@uiw/codemirror-theme-tomorrow-night-blue/esm/index.js");
|
|
41
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-vscode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-vscode/esm/light.js");
|
|
42
|
-
const dark = require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-vscode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-vscode/esm/dark.js");
|
|
43
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-white@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-white/esm/dark.js");
|
|
44
|
-
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-white@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-white/esm/light.js");
|
|
45
|
-
const index$7 = require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-xcode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-xcode/esm/index.js");
|
|
46
|
-
const index = require("../../../../node_modules/.pnpm/@codemirror_view@6.28.1/node_modules/@codemirror/view/dist/index.js");
|
|
47
|
-
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
|
|
48
|
-
...{
|
|
49
|
-
name: "JsonView",
|
|
50
|
-
inheritAttrs: false
|
|
51
|
-
},
|
|
52
|
-
__name: "json-view",
|
|
53
|
-
props: {
|
|
54
|
-
jsonObject: {
|
|
55
|
-
type: Object,
|
|
56
|
-
default: () => {
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
height: {
|
|
60
|
-
type: Number,
|
|
61
|
-
default: 0
|
|
62
|
-
},
|
|
63
|
-
theme: {
|
|
64
|
-
type: String,
|
|
65
|
-
default: null
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
setup(__props) {
|
|
69
|
-
const props = __props;
|
|
70
|
-
const editor = Vue.ref(null);
|
|
71
|
-
const cfCodemirrorJsonViewRef = Vue.ref();
|
|
72
|
-
const codemirrorHeight = Vue.ref("400px");
|
|
73
|
-
Vue.watch(
|
|
74
|
-
() => props.jsonObject,
|
|
75
|
-
(newVal) => {
|
|
76
|
-
if (editor.value) {
|
|
77
|
-
loadEditor();
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
{ deep: true }
|
|
81
|
-
);
|
|
82
|
-
Vue.onMounted(() => {
|
|
83
|
-
Vue.nextTick(() => {
|
|
84
|
-
loadEditor();
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
function loadEditor() {
|
|
88
|
-
if (editor.value) {
|
|
89
|
-
editor.value.destroy();
|
|
90
|
-
}
|
|
91
|
-
const jsonStr = props.jsonObject ? JSON.stringify(props.jsonObject, null, 2) : "";
|
|
92
|
-
if (props.height) {
|
|
93
|
-
codemirrorHeight.value = props.height + "px";
|
|
94
|
-
} else {
|
|
95
|
-
if (cfCodemirrorJsonViewRef.value) {
|
|
96
|
-
const rect = cfCodemirrorJsonViewRef.value.getBoundingClientRect();
|
|
97
|
-
if (rect.y || rect.y === 0) {
|
|
98
|
-
console.log("window.innerHeight - rect.y", window.innerHeight, rect.y);
|
|
99
|
-
codemirrorHeight.value = window.innerHeight - rect.y - 100 + "px";
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
const state = getEditorState(jsonStr);
|
|
104
|
-
let element = document.getElementById("cf-codemirror-view-json");
|
|
105
|
-
if (element) {
|
|
106
|
-
editor.value = new index.EditorView({
|
|
107
|
-
state,
|
|
108
|
-
parent: element
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
function getEditorState(jsonStr) {
|
|
113
|
-
const mytheme = getTheme();
|
|
114
|
-
const baseTheme = index.EditorView.theme({
|
|
115
|
-
".cm-content, .cm-gutter": { minHeight: codemirrorHeight.value },
|
|
116
|
-
"&": {
|
|
117
|
-
height: codemirrorHeight.value,
|
|
118
|
-
maxHeight: codemirrorHeight.value,
|
|
119
|
-
fontSize: "12px"
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
return index$1.EditorState.create({
|
|
123
|
-
doc: jsonStr,
|
|
124
|
-
extensions: [
|
|
125
|
-
index$1.EditorState.tabSize.of(16),
|
|
126
|
-
index$2.basicSetup,
|
|
127
|
-
index$3.jsonLanguage,
|
|
128
|
-
mytheme,
|
|
129
|
-
baseTheme,
|
|
130
|
-
readOnlyFacet.of(true),
|
|
131
|
-
preventChanges
|
|
132
|
-
]
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
const readOnlyFacet = index$1.Facet.define({ combine: (values) => values.some((a) => a) });
|
|
136
|
-
const preventChanges = index$1.EditorState.transactionFilter.of((tr) => {
|
|
137
|
-
if (tr.isUserEvent && tr.docChanged && tr.state.facet(readOnlyFacet)) {
|
|
138
|
-
return {
|
|
139
|
-
changes: {
|
|
140
|
-
from: tr.changes.from,
|
|
141
|
-
to: tr.changes.to,
|
|
142
|
-
insert: tr.startState.doc.sliceString(tr.changes.from, tr.changes.to)
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
return tr;
|
|
147
|
-
});
|
|
148
|
-
function getTheme() {
|
|
149
|
-
if (props.theme) {
|
|
150
|
-
switch (props.theme) {
|
|
151
|
-
case "xcodeLight":
|
|
152
|
-
return index$7.xcodeLight;
|
|
153
|
-
case "xcodeDark":
|
|
154
|
-
return index$7.xcodeDark;
|
|
155
|
-
case "vscodeDark":
|
|
156
|
-
return dark.vscodeDark;
|
|
157
|
-
case "dracula":
|
|
158
|
-
return index$6.dracula;
|
|
159
|
-
case "githubLight":
|
|
160
|
-
return index$5.githubLight;
|
|
161
|
-
case "githubDark":
|
|
162
|
-
return index$5.githubDark;
|
|
163
|
-
case "eclipse":
|
|
164
|
-
return index$4.eclipse;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
return index.EditorView.theme({});
|
|
168
|
-
}
|
|
169
|
-
return (_ctx, _cache) => {
|
|
170
|
-
return Vue.openBlock(), Vue.createElementBlock("div", {
|
|
171
|
-
style: {
|
|
172
|
-
width: "100%"
|
|
173
|
-
},
|
|
174
|
-
ref_key: "cfCodemirrorJsonViewRef",
|
|
175
|
-
ref: cfCodemirrorJsonViewRef,
|
|
176
|
-
id: "cf-codemirror-view-json"
|
|
177
|
-
}, null, 512);
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
});
|
|
181
|
-
module.exports = _sfc_main;
|
|
2
|
+
const jsonView_vue_vue_type_script_setup_true_lang = require("./json-view.vue2.js");
|
|
3
|
+
module.exports = jsonView_vue_vue_type_script_setup_true_lang;
|
|
@@ -1,3 +1,181 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
|
|
2
|
+
const Vue = require("vue");
|
|
3
|
+
const index$2 = require("../../../../node_modules/.pnpm/codemirror@6.0.1_@lezer_common@1.2.1/node_modules/codemirror/dist/index.js");
|
|
4
|
+
const index$3 = require("../../../../node_modules/.pnpm/@codemirror_lang-json@6.0.1/node_modules/@codemirror/lang-json/dist/index.js");
|
|
5
|
+
const index$1 = require("../../../../node_modules/.pnpm/@codemirror_state@6.4.1/node_modules/@codemirror/state/dist/index.js");
|
|
6
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-abcdef@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abcdef/esm/index.js");
|
|
7
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-abyss@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abyss/esm/index.js");
|
|
8
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-androidstudio@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-androidstudio/esm/index.js");
|
|
9
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-andromeda@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-andromeda/esm/index.js");
|
|
10
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-atomone@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-atomone/esm/index.js");
|
|
11
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-aura@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-aura/esm/index.js");
|
|
12
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-basic@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-basic/esm/dark.js");
|
|
13
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-basic@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-basic/esm/light.js");
|
|
14
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-bbedit@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-bbedit/esm/index.js");
|
|
15
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-bespin@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-bespin/esm/index.js");
|
|
16
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-console@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-console/esm/dark.js");
|
|
17
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-console@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-console/esm/light.js");
|
|
18
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-copilot@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-copilot/esm/index.js");
|
|
19
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-darcula@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-darcula/esm/index.js");
|
|
20
|
+
const index$6 = require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-dracula@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-dracula/esm/index.js");
|
|
21
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-duotone@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-duotone/esm/index.js");
|
|
22
|
+
const index$4 = require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-eclipse@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-eclipse/esm/index.js");
|
|
23
|
+
const index$5 = require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-github@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-github/esm/index.js");
|
|
24
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-gruvbox-dark@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-gruvbox-dark/esm/index.js");
|
|
25
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-kimbie@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-kimbie/esm/index.js");
|
|
26
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-material@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-material/esm/index.js");
|
|
27
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-monokai@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-monokai/esm/index.js");
|
|
28
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-monokai-dimmed@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-monokai-dimmed/esm/index.js");
|
|
29
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-noctis-lilac@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-noctis-lilac/esm/index.js");
|
|
30
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-nord@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-nord/esm/index.js");
|
|
31
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-okaidia@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-okaidia/esm/index.js");
|
|
32
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-quietlight@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-quietlight/esm/index.js");
|
|
33
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-red@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-red/esm/index.js");
|
|
34
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-solarized@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-solarized/esm/dark.js");
|
|
35
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-solarized@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-solarized/esm/light.js");
|
|
36
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-sublime@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-sublime/esm/index.js");
|
|
37
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-tokyo-night/esm/index.js");
|
|
38
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night-storm@4.22.2_@codemirror_language@6.10.2_@codemirror_state@_sg5tsucubbfkilam6qx2r2u7r4/node_modules/@uiw/codemirror-theme-tokyo-night-storm/esm/index.js");
|
|
39
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-tokyo-night-day@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-tokyo-night-day/esm/index.js");
|
|
40
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-tomorrow-night-blue@4.22.2_@codemirror_language@6.10.2_@codemirror_stat_4uqjswejhb57pqfwybv25yl5gi/node_modules/@uiw/codemirror-theme-tomorrow-night-blue/esm/index.js");
|
|
41
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-vscode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-vscode/esm/light.js");
|
|
42
|
+
const dark = require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-vscode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-vscode/esm/dark.js");
|
|
43
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-white@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-white/esm/dark.js");
|
|
44
|
+
require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-white@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-white/esm/light.js");
|
|
45
|
+
const index$7 = require("../../../../node_modules/.pnpm/@uiw_codemirror-theme-xcode@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-xcode/esm/index.js");
|
|
46
|
+
const index = require("../../../../node_modules/.pnpm/@codemirror_view@6.28.1/node_modules/@codemirror/view/dist/index.js");
|
|
47
|
+
const _sfc_main = /* @__PURE__ */ Vue.defineComponent({
|
|
48
|
+
...{
|
|
49
|
+
name: "JsonView",
|
|
50
|
+
inheritAttrs: false
|
|
51
|
+
},
|
|
52
|
+
__name: "json-view",
|
|
53
|
+
props: {
|
|
54
|
+
jsonObject: {
|
|
55
|
+
type: Object,
|
|
56
|
+
default: () => {
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
height: {
|
|
60
|
+
type: Number,
|
|
61
|
+
default: 0
|
|
62
|
+
},
|
|
63
|
+
theme: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: null
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
setup(__props) {
|
|
69
|
+
const props = __props;
|
|
70
|
+
const editor = Vue.ref(null);
|
|
71
|
+
const cfCodemirrorJsonViewRef = Vue.ref();
|
|
72
|
+
const codemirrorHeight = Vue.ref("400px");
|
|
73
|
+
Vue.watch(
|
|
74
|
+
() => props.jsonObject,
|
|
75
|
+
(newVal) => {
|
|
76
|
+
if (editor.value) {
|
|
77
|
+
loadEditor();
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{ deep: true }
|
|
81
|
+
);
|
|
82
|
+
Vue.onMounted(() => {
|
|
83
|
+
Vue.nextTick(() => {
|
|
84
|
+
loadEditor();
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
function loadEditor() {
|
|
88
|
+
if (editor.value) {
|
|
89
|
+
editor.value.destroy();
|
|
90
|
+
}
|
|
91
|
+
const jsonStr = props.jsonObject ? JSON.stringify(props.jsonObject, null, 2) : "";
|
|
92
|
+
if (props.height) {
|
|
93
|
+
codemirrorHeight.value = props.height + "px";
|
|
94
|
+
} else {
|
|
95
|
+
if (cfCodemirrorJsonViewRef.value) {
|
|
96
|
+
const rect = cfCodemirrorJsonViewRef.value.getBoundingClientRect();
|
|
97
|
+
if (rect.y || rect.y === 0) {
|
|
98
|
+
console.log("window.innerHeight - rect.y", window.innerHeight, rect.y);
|
|
99
|
+
codemirrorHeight.value = window.innerHeight - rect.y - 100 + "px";
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
const state = getEditorState(jsonStr);
|
|
104
|
+
let element = document.getElementById("cf-codemirror-view-json");
|
|
105
|
+
if (element) {
|
|
106
|
+
editor.value = new index.EditorView({
|
|
107
|
+
state,
|
|
108
|
+
parent: element
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function getEditorState(jsonStr) {
|
|
113
|
+
const mytheme = getTheme();
|
|
114
|
+
const baseTheme = index.EditorView.theme({
|
|
115
|
+
".cm-content, .cm-gutter": { minHeight: codemirrorHeight.value },
|
|
116
|
+
"&": {
|
|
117
|
+
height: codemirrorHeight.value,
|
|
118
|
+
maxHeight: codemirrorHeight.value,
|
|
119
|
+
fontSize: "12px"
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
return index$1.EditorState.create({
|
|
123
|
+
doc: jsonStr,
|
|
124
|
+
extensions: [
|
|
125
|
+
index$1.EditorState.tabSize.of(16),
|
|
126
|
+
index$2.basicSetup,
|
|
127
|
+
index$3.jsonLanguage,
|
|
128
|
+
mytheme,
|
|
129
|
+
baseTheme,
|
|
130
|
+
readOnlyFacet.of(true),
|
|
131
|
+
preventChanges
|
|
132
|
+
]
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const readOnlyFacet = index$1.Facet.define({ combine: (values) => values.some((a) => a) });
|
|
136
|
+
const preventChanges = index$1.EditorState.transactionFilter.of((tr) => {
|
|
137
|
+
if (tr.isUserEvent && tr.docChanged && tr.state.facet(readOnlyFacet)) {
|
|
138
|
+
return {
|
|
139
|
+
changes: {
|
|
140
|
+
from: tr.changes.from,
|
|
141
|
+
to: tr.changes.to,
|
|
142
|
+
insert: tr.startState.doc.sliceString(tr.changes.from, tr.changes.to)
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
return tr;
|
|
147
|
+
});
|
|
148
|
+
function getTheme() {
|
|
149
|
+
if (props.theme) {
|
|
150
|
+
switch (props.theme) {
|
|
151
|
+
case "xcodeLight":
|
|
152
|
+
return index$7.xcodeLight;
|
|
153
|
+
case "xcodeDark":
|
|
154
|
+
return index$7.xcodeDark;
|
|
155
|
+
case "vscodeDark":
|
|
156
|
+
return dark.vscodeDark;
|
|
157
|
+
case "dracula":
|
|
158
|
+
return index$6.dracula;
|
|
159
|
+
case "githubLight":
|
|
160
|
+
return index$5.githubLight;
|
|
161
|
+
case "githubDark":
|
|
162
|
+
return index$5.githubDark;
|
|
163
|
+
case "eclipse":
|
|
164
|
+
return index$4.eclipse;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return index.EditorView.theme({});
|
|
168
|
+
}
|
|
169
|
+
return (_ctx, _cache) => {
|
|
170
|
+
return Vue.openBlock(), Vue.createElementBlock("div", {
|
|
171
|
+
style: {
|
|
172
|
+
width: "100%"
|
|
173
|
+
},
|
|
174
|
+
ref_key: "cfCodemirrorJsonViewRef",
|
|
175
|
+
ref: cfCodemirrorJsonViewRef,
|
|
176
|
+
id: "cf-codemirror-view-json"
|
|
177
|
+
}, null, 512);
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
module.exports = _sfc_main;
|
|
@@ -5,7 +5,7 @@ const index$3 = require("../../../node_modules/.pnpm/@codemirror_lang-json@6.0.1
|
|
|
5
5
|
const index$1 = require("../../../node_modules/.pnpm/@codemirror_state@6.4.1/node_modules/@codemirror/state/dist/index.js");
|
|
6
6
|
const request = require("../../../node_modules/.pnpm/agilebuilder-ui@1.0.13_vue@3.4.21/node_modules/agilebuilder-ui/src/utils/request.js");
|
|
7
7
|
const logicFlow = require("../../../node_modules/.pnpm/@logicflow_core@1.2.27/node_modules/@logicflow/core/dist/logic-flow.js");
|
|
8
|
-
const jsonView_vue_vue_type_script_setup_true_lang = require("../../common/components/json-view/json-view.
|
|
8
|
+
const jsonView_vue_vue_type_script_setup_true_lang = require("../../common/components/json-view/json-view.vue2.js");
|
|
9
9
|
require("../../../node_modules/.pnpm/@uiw_codemirror-theme-abcdef@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abcdef/esm/index.js");
|
|
10
10
|
require("../../../node_modules/.pnpm/@uiw_codemirror-theme-abyss@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-abyss/esm/index.js");
|
|
11
11
|
require("../../../node_modules/.pnpm/@uiw_codemirror-theme-androidstudio@4.22.2_@codemirror_language@6.10.2_@codemirror_state@6.4.1_@codemirror_view@6.28.1/node_modules/@uiw/codemirror-theme-androidstudio/esm/index.js");
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "service-flow-designer",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.1",
|
|
4
4
|
"description": "AgileBuilder Workflow Library",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "./src/index.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist/*"
|
|
9
9
|
],
|
|
10
|
-
"typings": "dist/
|
|
10
|
+
"typings": "dist/es/index.d.ts",
|
|
11
11
|
"scripts": {
|
|
12
12
|
"dev": "vite",
|
|
13
13
|
"build": "run-p type-check \"build-only {@}\" --",
|