Skip to content

Commit 2a5211a

Browse files
committed
v2.6.0
Autocomplete Additive material Fixed #55 Closes #47 float notation in molang
1 parent b3f7fd1 commit 2a5211a

File tree

15 files changed

+548
-69
lines changed

15 files changed

+548
-69
lines changed

dist/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/plain-report.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
vue-color: 99.19 KB (4.61%)
2-
prismjs: 98.07 KB (4.56%)
3-
vue: 91.47 KB (4.25%)
4-
tinycolor2: 35.84 KB (1.67%)
5-
regenerator-runtime: 24.26 KB (1.13%)
6-
root: 21.3 KB (0.991%)
7-
style-loader: 13.1 KB (0.609%)
8-
setimmediate: 6.32 KB (0.294%)
9-
process: 5.29 KB (0.246%)
10-
css-loader: 2.21 KB (0.103%)
11-
timers-browserify: 1.97 KB (0.0918%)
12-
vue-prism-component: 1.69 KB (0.0787%)
13-
webpack: 472 B (0.0214%)
14-
@babel\runtime: 49 B (0.00223%)
15-
<self>: 1.71 MB (81.3%)
1+
vue-color: 99.19 KB (4.57%)
2+
prismjs: 98.07 KB (4.51%)
3+
vue: 91.47 KB (4.21%)
4+
tinycolor2: 35.84 KB (1.65%)
5+
root: 25.99 KB (1.20%)
6+
regenerator-runtime: 24.26 KB (1.12%)
7+
style-loader: 13.1 KB (0.603%)
8+
setimmediate: 6.32 KB (0.291%)
9+
process: 5.29 KB (0.244%)
10+
css-loader: 2.21 KB (0.102%)
11+
timers-browserify: 1.97 KB (0.0909%)
12+
vue-prism-component: 1.69 KB (0.0778%)
13+
webpack: 472 B (0.0212%)
14+
@babel\runtime: 49 B (0.00220%)
15+
<self>: 1.73 MB (81.3%)

package-lock.json

Lines changed: 13 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "snowstorm",
3-
"version": "2.5.0",
3+
"version": "2.6.0",
44
"description": "Minecraft Bedrock Edition particle editor",
55
"author": {
66
"name": "JannisX11",
@@ -37,13 +37,13 @@
3737
"dependencies": {
3838
"bootstrap": "^4.5.3",
3939
"fflate": "^0.7.3",
40-
"molangjs": "^1.6.0",
40+
"molangjs": "^1.6.1",
4141
"prismjs": "^1.28.0",
4242
"root": "github:JannisX11/vue-prism-editor",
4343
"three": "^0.129.0",
4444
"vue": "^2.6.12",
4545
"vue-color": "^2.8.0",
4646
"vue-prism-component": "^1.2.0",
47-
"wintersky": "^1.2.0"
47+
"wintersky": "^1.2.1"
4848
}
4949
}

service_worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const cacheName = 'snowstorm_2.2.3';
1+
const cacheName = 'snowstorm_2.6.0';
22
const staticAssets = [
33
'./index.html',
44
'./dist/app.js',

src/components/App.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,17 @@ if (!vscode) {
4646
localStorage.setItem('snowstorm_startup_count', startup_count)
4747
}
4848
49+
let portrait_view = document.body.clientWidth > 100 && document.body.clientWidth < 720
50+
4951
function getInitialSidebarWidth() {
50-
let {type, angle} = window.screen.orientation || {};
5152
let body_width = document.body.clientWidth;
5253
// Fix for VSCode
5354
if (body_width < 100) body_width = 1280;
54-
if (!type || type.includes('landscape')) {
55-
return Math.clamp(body_width/2, 160, 440);
56-
} else {
55+
56+
if (portrait_view) {
5757
return body_width;
58+
} else {
59+
return Math.clamp(body_width/2, 160, 440);
5860
}
5961
}
6062
@@ -67,7 +69,7 @@ export default {
6769
dialog: null,
6870
showVSCodeInfoBox: (!vscode && [1, 3, 7, 11, 24].includes(startup_count)),
6971
sidebar_width: getInitialSidebarWidth(),
70-
portrait_view: window.screen.orientation && window.screen.orientation.type.includes('portrait'),
72+
portrait_view,
7173
}},
7274
methods: {
7375
setTab(tab) {

src/components/ExpressionBar.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
<template>
22
<div id="expression_bar">
3-
<prism-editor v-model="code" :value="code" @input="updateInput($event, true)" :highlight="highlighter" :line-numbers="false" ref="input" />
3+
<prism-editor v-model="code"
4+
:value="code"
5+
@input="updateInput($event, true)"
6+
:autocomplete="autocomplete"
7+
:highlight="highlighter"
8+
:line-numbers="false"
9+
ref="input"
10+
/>
411
</div>
512
</template>
613

714
<script>
815
import App from "./App";
916
17+
import getAutocompleteData from './../molang_autocomplete'
1018
import 'root/packages/vue-prism-editor/dist/prismeditor.min.css';
1119
import Prism from 'prismjs/components/prism-core';
1220
import {PrismEditor} from "root/packages/vue-prism-editor";
@@ -30,6 +38,9 @@ export default {
3038
language: 'generic'
3139
}},
3240
methods: {
41+
autocomplete(text, position) {
42+
return getAutocompleteData(text, position, 'input')
43+
},
3344
highlighter() {
3445
return Prism.highlight(this.code, Languages[this.language])
3546
},
@@ -90,6 +101,5 @@ export {ExpandedInput}
90101
font-family: var(--font-code);
91102
outline: none;
92103
padding: 5px 8px;
93-
overflow-x: auto;
94104
}
95105
</style>>

src/components/MenuBar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<ul id="menu_bar">
3-
<li v-for="menu in Menu" :key="menu.id">
3+
<li v-for="menu in Menu" :key="menu.id" onclick="">
44
<a>{{ menu.label }}</a>
55
<ul class="menu_dropdown">
66
<li v-for="entry in menu.children" :key="entry.id" v-on:click="entry.click(getVM(), $event)">

src/components/Sidebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default {
7171
}
7272
.input_subject {
7373
border-right: 1px solid var(--color-border);
74-
overflow-x: hidden;
74+
overflow-x: visible;
7575
}
7676
.input_subject h3 {
7777
background-color: var(--color-title);

src/components/Sidebar/InputGroup.vue

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020
<ul class="input_list">
2121
<li v-for="(item, index) in input.value" :key="index">
2222
<!--Text-->
23-
<div class="prism_editor_outer_wrapper" v-if="input.type == 'text' || input.type == 'molang'">
24-
<prism-editor :highlight="input.type == 'molang' ? highlightMolang : highlightGeneric" language="" :line-numbers="false"
25-
v-model="input.value[index]"
26-
v-bind:placeholder="input.placeholder"
27-
v-bind:index="index"
28-
v-on:input="input.emitInput($event)"
29-
v-on:focus="input.focus(index, $event)" />
30-
</div>
23+
<prism-editor :highlight="input.type == 'molang' ? highlightMolang : highlightGeneric" language="" :line-numbers="false"
24+
v-if="input.type == 'text' || input.type == 'molang'"
25+
v-model="input.value[index]"
26+
v-bind:placeholder="input.placeholder"
27+
v-bind:index="index"
28+
:autocomplete="input.type == 'molang' ? autocomplete : null"
29+
v-on:input="input.emitInput($event)"
30+
v-on:focus="input.focus(index, $event)"
31+
/>
3132
<!--Number-->
3233
<input
3334
v-if="input.type == 'number'" type="number"
@@ -42,14 +43,15 @@
4243

4344
<template v-if="input.axis_count == 1">
4445
<!--Text-->
45-
<div class="prism_editor_outer_wrapper" v-if="input.type == 'text' || input.type == 'molang'">
46-
<prism-editor :highlight="input.type == 'molang' ? highlightMolang : highlightGeneric" language="" :line-numbers="false"
47-
v-model="input.value"
48-
:value="input.value.toString()"
49-
v-bind:placeholder="input.placeholder"
50-
v-on:input="input.emitInput($event)"
51-
v-on:focus="input.focus(-1, $event)" />
52-
</div>
46+
<prism-editor :highlight="input.type == 'molang' ? highlightMolang : highlightGeneric" language="" :line-numbers="false"
47+
v-if="input.type == 'text' || input.type == 'molang'"
48+
v-model="input.value"
49+
:value="input.value.toString()"
50+
v-bind:placeholder="input.placeholder"
51+
:autocomplete="input.type == 'molang' ? autocomplete : null"
52+
v-on:input="input.emitInput($event)"
53+
v-on:focus="input.focus(-1, $event)"
54+
/>
5355
<!--Number-->
5456
<input
5557
v-if="input.type == 'number'" type="number"
@@ -65,8 +67,9 @@
6567
<prism-editor :highlight="input.type == 'molang' ? highlightMolang : highlightGeneric" :line-numbers="false"
6668
v-model="input.value[i-1]"
6769
:value="input.value[i-1].toString()"
68-
v-bind:index="i-1"
69-
v-bind:placeholder="input.placeholder"
70+
:index="i-1"
71+
:placeholder="input.placeholder"
72+
:autocomplete="input.type == 'molang' ? autocomplete : null"
7073
v-on:input="input.emitInput($event)"
7174
v-on:focus="input.focus(i-1, $event)" />
7275
</div>
@@ -78,7 +81,7 @@
7881
:key="i"
7982
v-model="input.value[i-1]"
8083
:step="input.step" :min="input.min" :max="input.max"
81-
v-bind:index="i-1"
84+
:index="i-1"
8285
v-on:input="input.change($event)">
8386
</template>
8487
</template>
@@ -124,7 +127,7 @@ import VueColor from 'vue-color'
124127
import Gradient from './Gradient';
125128
126129
127-
130+
import getAutocompleteData from './../../molang_autocomplete'
128131
import 'root/packages/vue-prism-editor/dist/prismeditor.min.css';
129132
import Prism from 'prismjs/components/prism-core';
130133
import {PrismEditor} from "root/packages/vue-prism-editor";
@@ -163,6 +166,9 @@ export default {
163166
highlightGeneric(code) {
164167
return Prism.highlight(code, Languages.generic)
165168
},
169+
autocomplete(text, position) {
170+
return getAutocompleteData(text, position, 'input')
171+
},
166172
toggleExpand(input) {
167173
if (input.expandable) {
168174
input.expanded = !input.expanded;
@@ -215,7 +221,7 @@ export default {
215221
.input_list li {
216222
margin: 2px 0;
217223
}
218-
ul.input_list input, ul.input_list .prism_editor_outer_wrapper {
224+
ul.input_list input, ul.input_list .prism-editor-component {
219225
width: calc(100% - 80px);
220226
margin-left: 52px;
221227
float: left;

0 commit comments

Comments
 (0)