@appscode/design-system 1.0.43-alpha.121 → 1.0.43-alpha.122

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appscode/design-system",
3
- "version": "1.0.43-alpha.121",
3
+ "version": "1.0.43-alpha.122",
4
4
  "description": "A design system for Appscode websites and dashboards made using Bulma",
5
5
  "main": "main.scss",
6
6
  "scripts": {
@@ -7,7 +7,6 @@
7
7
  />
8
8
  <monaco-editor
9
9
  v-if="activeTab === 'edit'"
10
- ref="monacoEditor"
11
10
  @editorDidMount="onEditorMount"
12
11
  key="edit"
13
12
  :class="`vh-${editorHeight} is-clipped`"
@@ -16,12 +15,12 @@
16
15
  :language="language"
17
16
  :options="{
18
17
  minimap: {
19
- enabled: calcShowMinimap
18
+ enabled: calcShowMinimap,
20
19
  },
21
20
  theme: theme,
22
21
  readOnly: readOnly,
23
22
  wordWrap: wordWrap,
24
- scrollBeyondLastLine: false
23
+ scrollBeyondLastLine: false,
25
24
  }"
26
25
  />
27
26
  <monaco-editor
@@ -32,12 +31,12 @@
32
31
  :language="language"
33
32
  :options="{
34
33
  minimap: {
35
- enabled: calcShowMinimap
34
+ enabled: calcShowMinimap,
36
35
  },
37
36
  theme: theme,
38
37
  readOnly: true,
39
38
  wordWrap: wordWrap,
40
- scrollBeyondLastLine: false
39
+ scrollBeyondLastLine: false,
41
40
  }"
42
41
  :original="originalEditorContent"
43
42
  :diff-editor="true"
@@ -51,35 +50,35 @@ export default defineComponent({
51
50
  props: {
52
51
  value: {
53
52
  type: String,
54
- default: ""
53
+ default: "",
55
54
  },
56
55
  originalValue: {
57
56
  type: String,
58
- default: ""
57
+ default: "",
59
58
  },
60
59
  readOnly: {
61
60
  type: Boolean,
62
- default: false
61
+ default: false,
63
62
  },
64
63
  language: {
65
64
  type: String,
66
- default: "yaml"
65
+ default: "yaml",
67
66
  },
68
67
  showMinimap: {
69
68
  type: Boolean,
70
- default: true
69
+ default: true,
71
70
  },
72
71
  editorHeight: {
73
72
  type: Number,
74
- default: 40
73
+ default: 40,
75
74
  },
76
75
  editorTheme: {
77
76
  type: String,
78
- default: ""
77
+ default: "",
79
78
  },
80
79
  wordWrap: {
81
80
  type: String,
82
- default: "off"
81
+ default: "off",
83
82
  },
84
83
  },
85
84
 
@@ -87,23 +86,18 @@ export default defineComponent({
87
86
 
88
87
  components: {
89
88
  EditorTabs: defineAsyncComponent(() =>
90
- import("../tabs/EditorTabs.vue").then(module => module.default)
89
+ import("../tabs/EditorTabs.vue").then((module) => module.default)
91
90
  ),
92
91
  MonacoEditor: defineAsyncComponent(() =>
93
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
94
- // @ts-ignore
95
- import("vue-monaco").then(module => {
96
- module.default.render = () => h("div");
97
- return module.default;
98
- })
99
- )
92
+ import("monaco-editor-vue3").then((module) => module.default)
93
+ ),
100
94
  },
101
95
 
102
96
  data() {
103
97
  return {
104
98
  activeTab: "edit",
105
99
  editorContent: "",
106
- originalEditorContent: ""
100
+ originalEditorContent: "",
107
101
  };
108
102
  },
109
103
 
@@ -119,7 +113,7 @@ export default defineComponent({
119
113
  ? "vs-dark"
120
114
  : "vs")
121
115
  );
122
- }
116
+ },
123
117
  },
124
118
 
125
119
  watch: {
@@ -129,7 +123,7 @@ export default defineComponent({
129
123
  if (this.editorContent !== n) {
130
124
  this.editorContent = n;
131
125
  }
132
- }
126
+ },
133
127
  },
134
128
  originalValue: {
135
129
  immediate: true,
@@ -137,21 +131,20 @@ export default defineComponent({
137
131
  if (this.originalEditorContent !== n) {
138
132
  this.originalEditorContent = n;
139
133
  }
140
- }
141
- }
134
+ },
135
+ },
142
136
  },
143
137
 
144
138
  methods: {
145
139
  onChange(e) {
146
140
  if (typeof e === "string") this.editorContent = e;
147
141
  },
148
- onEditorMount() {
149
- const editor = this.$refs.monacoEditor.getEditor();
142
+ onEditorMount(editor) {
150
143
  // add event listeners
151
144
  editor.onDidBlurEditorText(() => {
152
145
  this.$emit("update:modelValue", this.editorContent);
153
146
  });
154
- }
155
- }
147
+ },
148
+ },
156
149
  });
157
150
  </script>