@jx3box/jx3box-editor 1.4.8 → 1.4.9

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.
@@ -0,0 +1,522 @@
1
+ {
2
+ "remarks": [
3
+ "这个文件用于存储游戏内的字体ini",
4
+ "但是由于大部分场景下我们只需要字体的颜色",
5
+ "而且存在着很多个字体id对应同一种颜色的情况",
6
+ "所以用颜色作为键,值是一个数组,包含着颜色是键值的所有字体ID"
7
+ ],
8
+ "#ffffff": [
9
+ "0",
10
+ "2",
11
+ "3",
12
+ "5",
13
+ "7",
14
+ "9",
15
+ "10",
16
+ "13",
17
+ "15",
18
+ "18",
19
+ "22",
20
+ "26",
21
+ "28",
22
+ "37",
23
+ "40",
24
+ "41",
25
+ "42",
26
+ "44",
27
+ "106",
28
+ "135",
29
+ "162",
30
+ "175",
31
+ "190",
32
+ "197",
33
+ "203",
34
+ "207",
35
+ "210",
36
+ "211",
37
+ "212",
38
+ "213",
39
+ "214",
40
+ "216",
41
+ "227",
42
+ "228",
43
+ "230",
44
+ "231",
45
+ "232",
46
+ "233",
47
+ "234",
48
+ "238",
49
+ "244",
50
+ "245",
51
+ "247",
52
+ "248",
53
+ "250",
54
+ "254",
55
+ "257",
56
+ "259",
57
+ "263",
58
+ "264",
59
+ "272",
60
+ "273",
61
+ "276",
62
+ "292",
63
+ "300",
64
+ "301",
65
+ "303",
66
+ "304",
67
+ "310",
68
+ "324",
69
+ "327",
70
+ "329",
71
+ "331",
72
+ "332",
73
+ "336",
74
+ "339",
75
+ "343",
76
+ "344",
77
+ "362",
78
+ "371"
79
+ ],
80
+ "#000000": [
81
+ "1",
82
+ "6",
83
+ "29",
84
+ "38",
85
+ "43",
86
+ "156",
87
+ "160",
88
+ "180",
89
+ "191",
90
+ "225",
91
+ "260",
92
+ "269",
93
+ "288",
94
+ "326"
95
+ ],
96
+ "#282828": [
97
+ "4",
98
+ "296",
99
+ "312"
100
+ ],
101
+ "#ffff00": [
102
+ "8",
103
+ "11",
104
+ "14",
105
+ "16",
106
+ "23",
107
+ "27",
108
+ "31",
109
+ "48",
110
+ "59",
111
+ "65",
112
+ "99",
113
+ "100",
114
+ "136",
115
+ "163",
116
+ "187",
117
+ "188",
118
+ "200",
119
+ "201",
120
+ "204",
121
+ "236",
122
+ "241",
123
+ "258",
124
+ "289",
125
+ "306",
126
+ "315",
127
+ "328",
128
+ "330",
129
+ "334",
130
+ "372"
131
+ ],
132
+ "#ff7e7e": [
133
+ "12",
134
+ "17",
135
+ "51",
136
+ "52",
137
+ "53",
138
+ "54",
139
+ "55",
140
+ "56",
141
+ "57",
142
+ "58",
143
+ "70",
144
+ "85",
145
+ "86",
146
+ "87",
147
+ "88",
148
+ "89",
149
+ "90",
150
+ "91",
151
+ "92",
152
+ "93",
153
+ "94",
154
+ "95",
155
+ "96",
156
+ "97",
157
+ "98",
158
+ "111",
159
+ "114",
160
+ "115",
161
+ "116",
162
+ "117",
163
+ "118",
164
+ "119",
165
+ "120",
166
+ "121",
167
+ "122",
168
+ "123",
169
+ "124",
170
+ "125",
171
+ "126",
172
+ "127",
173
+ "128",
174
+ "129",
175
+ "130",
176
+ "140",
177
+ "141",
178
+ "142",
179
+ "143",
180
+ "144",
181
+ "145",
182
+ "146",
183
+ "147",
184
+ "148",
185
+ "149",
186
+ "150",
187
+ "151",
188
+ "152",
189
+ "153",
190
+ "154",
191
+ "178",
192
+ "179",
193
+ "279",
194
+ "320",
195
+ "370"
196
+ ],
197
+ "#a3b06a": [
198
+ "19",
199
+ "39",
200
+ "66"
201
+ ],
202
+ "#ff0000": [
203
+ "20",
204
+ "33",
205
+ "71",
206
+ "102",
207
+ "137",
208
+ "159",
209
+ "166",
210
+ "217",
211
+ "219",
212
+ "270",
213
+ "308",
214
+ "317"
215
+ ],
216
+ "#00c848": [
217
+ "21",
218
+ "36",
219
+ "80",
220
+ "105",
221
+ "165",
222
+ "167",
223
+ "222",
224
+ "226",
225
+ "287",
226
+ "316",
227
+ "365",
228
+ "369"
229
+ ],
230
+ "#ff9600": [
231
+ "24",
232
+ "32",
233
+ "68",
234
+ "101",
235
+ "164",
236
+ "168",
237
+ "237",
238
+ "256",
239
+ "318",
240
+ "335",
241
+ "366"
242
+ ],
243
+ "#adadad": [
244
+ "25",
245
+ "30",
246
+ "61",
247
+ "108",
248
+ "132",
249
+ "161",
250
+ "169",
251
+ "220",
252
+ "319",
253
+ "333"
254
+ ],
255
+ "#df12c9": [
256
+ "34",
257
+ "74",
258
+ "103",
259
+ "367"
260
+ ],
261
+ "#007eff": [
262
+ "35",
263
+ "77",
264
+ "104",
265
+ "285",
266
+ "323",
267
+ "368"
268
+ ],
269
+ "#cfcfcf": [
270
+ "45",
271
+ "60",
272
+ "107",
273
+ "131",
274
+ "189",
275
+ "215",
276
+ "221",
277
+ "223",
278
+ "261",
279
+ "283",
280
+ "374"
281
+ ],
282
+ "#969696": [
283
+ "46",
284
+ "62",
285
+ "109",
286
+ "133",
287
+ "218"
288
+ ],
289
+ "#04d1b6": [
290
+ "47"
291
+ ],
292
+ "#fff78e": [
293
+ "49",
294
+ "155"
295
+ ],
296
+ "#636363": [
297
+ "50",
298
+ "63",
299
+ "110",
300
+ "134",
301
+ "313"
302
+ ],
303
+ "#ffffbb": [
304
+ "64",
305
+ "177",
306
+ "182",
307
+ "185",
308
+ "239",
309
+ "375"
310
+ ],
311
+ "#ffca7e": [
312
+ "67",
313
+ "157",
314
+ "266",
315
+ "321"
316
+ ],
317
+ "#a96300": [
318
+ "69",
319
+ "158",
320
+ "240",
321
+ "307"
322
+ ],
323
+ "#a90000": [
324
+ "72",
325
+ "337",
326
+ "338",
327
+ "340"
328
+ ],
329
+ "#ca7eff": [
330
+ "73",
331
+ "112",
332
+ "195",
333
+ "278",
334
+ "305"
335
+ ],
336
+ "#5e1ba0": [
337
+ "75",
338
+ "181"
339
+ ],
340
+ "#7e7eff": [
341
+ "76",
342
+ "113",
343
+ "193"
344
+ ],
345
+ "#0000a9": [
346
+ "78"
347
+ ],
348
+ "#7ee3a3": [
349
+ "79",
350
+ "139",
351
+ "176",
352
+ "192",
353
+ "194",
354
+ "282"
355
+ ],
356
+ "#00842f": [
357
+ "81",
358
+ "138"
359
+ ],
360
+ "#e68c00": [
361
+ "82",
362
+ "294",
363
+ "295",
364
+ "325"
365
+ ],
366
+ "#dc1e00": [
367
+ "83"
368
+ ],
369
+ "#968c00": [
370
+ "84"
371
+ ],
372
+ "#606000": [
373
+ "170"
374
+ ],
375
+ "#1e366c": [
376
+ "171"
377
+ ],
378
+ "#8b2e1c": [
379
+ "172",
380
+ "293",
381
+ "299"
382
+ ],
383
+ "#105830": [
384
+ "173",
385
+ "309"
386
+ ],
387
+ "#45544b": [
388
+ "174"
389
+ ],
390
+ "#1e68fe": [
391
+ "183"
392
+ ],
393
+ "#ef370c": [
394
+ "184",
395
+ "208",
396
+ "235"
397
+ ],
398
+ "#4cdf15": [
399
+ "186",
400
+ "229"
401
+ ],
402
+ "#ff0012": [
403
+ "196",
404
+ "199"
405
+ ],
406
+ "#4fff6c": [
407
+ "198"
408
+ ],
409
+ "#33f3ff": [
410
+ "202",
411
+ "205",
412
+ "252",
413
+ "253",
414
+ "262"
415
+ ],
416
+ "#30bdd6": [
417
+ "206",
418
+ "281"
419
+ ],
420
+ "undefined": [
421
+ "209"
422
+ ],
423
+ "#fbeab7": [
424
+ "224",
425
+ "274",
426
+ "275",
427
+ "311",
428
+ "342"
429
+ ],
430
+ "#453d2a": [
431
+ "242",
432
+ "341"
433
+ ],
434
+ "#bafbdf": [
435
+ "243",
436
+ "246",
437
+ "249",
438
+ "255"
439
+ ],
440
+ "#ffde00": [
441
+ "251",
442
+ "271",
443
+ "280"
444
+ ],
445
+ "#96cedf": [
446
+ "265"
447
+ ],
448
+ "#fab07e": [
449
+ "267"
450
+ ],
451
+ "#e8c368": [
452
+ "268"
453
+ ],
454
+ "#99452b": [
455
+ "277"
456
+ ],
457
+ "#0b0b0b": [
458
+ "284"
459
+ ],
460
+ "#df11c9": [
461
+ "286"
462
+ ],
463
+ "#3e281b": [
464
+ "290",
465
+ "291",
466
+ "373"
467
+ ],
468
+ "#493c23": [
469
+ "297",
470
+ "298"
471
+ ],
472
+ "#46332b": [
473
+ "302",
474
+ "314",
475
+ "349"
476
+ ],
477
+ "#92de5f": [
478
+ "322"
479
+ ],
480
+ "#776859": [
481
+ "345",
482
+ "352"
483
+ ],
484
+ "#735c3c": [
485
+ "346",
486
+ "347",
487
+ "355",
488
+ "356"
489
+ ],
490
+ "#615044": [
491
+ "348"
492
+ ],
493
+ "#513301": [
494
+ "350",
495
+ "354",
496
+ "357"
497
+ ],
498
+ "#ece4cc": [
499
+ "351"
500
+ ],
501
+ "#fef9e7": [
502
+ "353"
503
+ ],
504
+ "#92bcb4": [
505
+ "358"
506
+ ],
507
+ "#6fa497": [
508
+ "359"
509
+ ],
510
+ "#bce5db": [
511
+ "360"
512
+ ],
513
+ "#e3d7c7": [
514
+ "361"
515
+ ],
516
+ "#95b9ba": [
517
+ "363"
518
+ ],
519
+ "#a9a7a3": [
520
+ "364"
521
+ ]
522
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,8 +31,8 @@
31
31
  "last 2 versions"
32
32
  ],
33
33
  "dependencies": {
34
- "@jx3box/jx3box-common": "^7.2.1",
35
- "@jx3box/jx3box-data": "^1.8.3",
34
+ "@jx3box/jx3box-common": "^7.4.2",
35
+ "@jx3box/jx3box-data": "^1.11.1",
36
36
  "@jx3box/jx3box-emotion": "^1.0.10",
37
37
  "@jx3box/jx3box-macro": "^1.0.1",
38
38
  "@jx3box/jx3box-talent": "^1.1.2",
@@ -0,0 +1,20 @@
1
+ /*
2
+ * @Author: X3ZvaWQ
3
+ * @Date: 2022-08-20 22:17:27
4
+ * @LastEditors: X3ZvaWQ
5
+ * @LastEditTime: 2022-08-20 23:54:41
6
+ * @Description:
7
+ */
8
+ import { $node } from "@jx3box/jx3box-common/js/https";
9
+ const $ = $node();
10
+
11
+ /* import axios from 'axios'
12
+ const $ = axios.create({
13
+ baseURL: 'http://localhost:7002/',
14
+ }) */
15
+
16
+ function getResource(id, client = 'std') {
17
+ return $.get(`/resource/${client}/${id}`);
18
+ }
19
+
20
+ export { getResource };
@@ -0,0 +1,144 @@
1
+ <!--
2
+ * @Author: X3ZvaWQ
3
+ * @Date: 2022-08-20 20:23:57
4
+ * @LastEditors: X3ZvaWQ
5
+ * @LastEditTime: 2022-08-20 23:12:34
6
+ * @Description: 用于渲染游戏内Text标签的文本
7
+ -->
8
+ <template>
9
+ <span v-html="html"></span>
10
+ </template>
11
+
12
+ <script>
13
+ import { extractTextContent, getLink } from "@jx3box/jx3box-common/js/utils";
14
+ import { getResource } from "../service/resource";
15
+
16
+ export default {
17
+ name: "GameText",
18
+ props: {
19
+ text: {
20
+ type: String,
21
+ default: "",
22
+ },
23
+ client: {
24
+ type: String,
25
+ default: "std",
26
+ },
27
+ },
28
+ data: function () {
29
+ return {
30
+ html: "",
31
+ };
32
+ },
33
+ methods: {
34
+ /**
35
+ * 渲染某一个单独的Text标签成Span或链接
36
+ * @param {*} school_id
37
+ * @returns
38
+ */
39
+ renderItemHtml: function (item) {
40
+ let content = item.text;
41
+ let style = ``;
42
+ let link = null;
43
+ content = content.replace(/\n/g, "<br />").replace(/\\/g, "");
44
+ if ([item.r, item.g, item.b].every((v) => v != undefined && v > 0)) {
45
+ style = `color: rgb(${item.r}, ${item.g}, ${item.b});`;
46
+ } else if (item.font != undefined) {
47
+ const fonts = require("../assets/data/game_font.json");
48
+ for (let color in fonts) {
49
+ if (fonts[color].includes(item.font)) {
50
+ style = `color: ${color};`;
51
+ break;
52
+ }
53
+ }
54
+ }
55
+ if (item.name == "iteminfolink" && item.script) {
56
+ let item_type = item.script?.match(/this\.dwTabType=(\d+)/i)?.[1];
57
+ let item_index = item.script?.match(/this\.dwIndex=(\d+)/i)?.[1];
58
+ if (item_type && item_index) {
59
+ let item_id = `${item_type}_${item_index}`;
60
+ link = getLink("item", item_id);
61
+ }
62
+ }
63
+ if (link) {
64
+ return `<a style="${style} text-decoration: none;" target="_blank" href="${link}">${content}</a>`;
65
+ } else {
66
+ return `<span style="${style}">${content}</span>`;
67
+ }
68
+ },
69
+ /**
70
+ * 将一段游戏内文本转换为Html
71
+ * @param {Object[]} texts 标签对象
72
+ */
73
+ renderTextHtml: function (Text) {
74
+ let result = Text;
75
+ const matches = Text.match(/<Text>(.*?)<\/text>/gimsy);
76
+ if (!matches) return Text;
77
+ for (let match of matches) {
78
+ let text = extractTextContent(match);
79
+ let html = this.renderItemHtml(text[0]);
80
+ result = result.replace(match, html);
81
+ }
82
+ return result;
83
+ },
84
+ /**
85
+ * 获取形如<BUFF 110 1 desc>的资源字段并转换
86
+ */
87
+ renderResource: function () {
88
+ const matches = this.html.match(/<BUFF (\d+) (\d+) (.*?)>/gim);
89
+ if (!matches) return;
90
+ for (let match of matches) {
91
+ let [, id, level, type] = match.match(/<BUFF (\d+) (\d+) (.*?)>/i);
92
+ type = type.toLowerCase();
93
+ let type_map = {
94
+ desc: "Desc",
95
+ time: "Interval",
96
+ };
97
+ getResource(`buff.${id}_${level}`, this.client)
98
+ .then((res) => {
99
+ let data = res.data;
100
+ let attr = type_map[type] || type;
101
+ let value = data[attr];
102
+ if (typeof value == "number" && type == "time") {
103
+ let time = value / 16;
104
+ if (time > 60) {
105
+ time = `${Math.floor(time / 60)}分钟`;
106
+ } else {
107
+ time = `${time}秒`;
108
+ }
109
+ this.html = this.html.replace(match, time);
110
+ return;
111
+ }
112
+ if (!value) return;
113
+ let _matches = value.match(/<BUFF ([0-9a-zA-Z]+)>/gi);
114
+ if (!_matches) this.html = this.html.replace(match, value);
115
+ for (let _match of _matches) {
116
+ let [, _attr] = _match.match(/<BUFF ([0-9a-zA-Z]+)>/i);
117
+ for (let i = 1; i < 15; i++) {
118
+ if (data[`BeginAttrib${i}`] == _attr) {
119
+ value = value.replace(_match, data[`BeginValue${i}A`]);
120
+ }
121
+ }
122
+ }
123
+ this.html = this.html.replace(match, value);
124
+ })
125
+ .catch((err) => {
126
+ console.log(err);
127
+ });
128
+ }
129
+ },
130
+ },
131
+ watch: {
132
+ text: {
133
+ immediate: true,
134
+ handler: function (val) {
135
+ this.html = this.renderTextHtml(val);
136
+ this.renderResource();
137
+ },
138
+ },
139
+ },
140
+ };
141
+ </script>
142
+
143
+ <style>
144
+ </style>
package/src/Item.vue CHANGED
@@ -175,11 +175,11 @@
175
175
  <img :src="source.ImageUrl" @error.once="source.ImageUrl=null" />
176
176
  </div>
177
177
  <!-- 描述 -->
178
- <p
178
+ <p
179
179
  v-if="source.DescHtml"
180
- class="u-desc u-yellow"
181
- v-html="formatDescHtml(source.DescHtml)"
182
- ></p>
180
+ class="u-desc u-yellow">
181
+ <game-text :client="client" :text="source.DescHtml || source.Desc"></game-text>
182
+ </p>
183
183
  <!-- 五彩石属性 -->
184
184
  <p v-if="source.WuCaiHtml" class="u-desc" v-html="source.WuCaiHtml"></p>
185
185
  <!-- 品质等级 -->
@@ -243,6 +243,8 @@
243
243
  <script>
244
244
  import { get_item } from "../service/item.js";
245
245
 
246
+ import GameText from "./GameText.vue";
247
+
246
248
  import attribute_percent from "../assets/js/item/attribute_percent.js";
247
249
  import bind from "../assets/js/item/bind.js";
248
250
  import color from "../assets/js/item/color.js";
@@ -255,12 +257,28 @@ dayjs.extend(duration);
255
257
 
256
258
  export default {
257
259
  name: "Item",
258
- props: ["item", "item_id", "jx3ClientType","client"],
260
+ props: {
261
+ item: {
262
+ type: Object
263
+ },
264
+ item_id: {
265
+ type: String
266
+ },
267
+ client: {
268
+ type: String
269
+ },
270
+ jx3ClientType: {
271
+ type: Number
272
+ },
273
+ },
259
274
  data() {
260
275
  return {
261
276
  source: null,
262
277
  };
263
278
  },
279
+ components: {
280
+ GameText
281
+ },
264
282
  computed : {
265
283
  // 兼容旧版传值
266
284
  env_client_id : function (){
package/src/Tinymce.vue CHANGED
@@ -23,7 +23,7 @@
23
23
  >进入特殊区域(代码块,折叠块等等)脱离或使用工具栏触发后,请使用键盘方向
24
24
  → ↓
25
25
  键进行脱离,回车只是正常在区块内换行。去掉样式点击第二行第一个&lt;清除格式&gt;即可复位。<a
26
- href="/tool/16227"
26
+ href="/collection/31"
27
27
  target="_blank"
28
28
  >[编辑器使用指南]</a
29
29
  >