@jx3box/jx3box-editor 2.2.35 → 2.2.37

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.
@@ -85,8 +85,8 @@
85
85
  background-color: rgba(15, 34, 34, 0.88);
86
86
  // background-color: #0f2222;
87
87
  color: #ffffff;
88
-
89
- *{
88
+
89
+ * {
90
90
  font-weight: normal;
91
91
  font-size: 13.6px;
92
92
  line-height: 1.5em;
@@ -237,5 +237,38 @@
237
237
  .pr(10px);
238
238
  }
239
239
  }
240
+
241
+ .u-get-source {
242
+ margin-top: 1rem;
243
+ }
244
+
245
+ .u-get-source-header {
246
+ color: #ffa500;
247
+ }
248
+
249
+ .u-get-source-list {
250
+ padding-left: 0.9rem;
251
+ }
252
+
253
+ .u-get-source-child {
254
+ color: #00c848;
255
+ .pr;
256
+
257
+ &.is-link {
258
+ .pointer;
259
+ }
260
+
261
+ &::before {
262
+ .pa;
263
+ left: -0.9rem;
264
+ content: "➻";
265
+ margin-right: 0.2rem;
266
+ color: #00c848;
267
+ }
268
+ }
269
+
270
+ .u-get-source-type {
271
+ color: #ffff00;
272
+ }
240
273
  }
241
274
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jx3box/jx3box-editor",
3
- "version": "2.2.35",
3
+ "version": "2.2.37",
4
4
  "description": "JX3BOX Article & Editor",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -81,8 +81,5 @@
81
81
  "repository": {
82
82
  "type": "git",
83
83
  "url": "git+https://github.com/JX3BOX/jx3box-editor.git"
84
- },
85
- "overrides": {
86
- "stylus": "https://github.com/stylus/stylus/archive/refs/tags/0.54.5.tar.gz"
87
84
  }
88
85
  }
package/src/Item.vue CHANGED
@@ -78,8 +78,8 @@
78
78
  class="u-attributes"
79
79
  v-if="source.attributes && source.attributes.length">
80
80
  <div
81
- v-for="(attribute, key) in common_attributes"
82
- :key="key"
81
+ v-for="attribute in common_attributes"
82
+ :key="attribute.type"
83
83
  class="u-field"
84
84
  :class="[`u-${attribute.color}`]">
85
85
  <span
@@ -113,8 +113,8 @@
113
113
  </div>
114
114
  <div
115
115
  class="u-value u-spec-attribute"
116
- v-for="(attribute, key) in orange_std_attribute"
117
- :key="key">
116
+ v-for="attribute in orange_std_attribute"
117
+ :key="attribute.label">
118
118
  <game-text :text="attribute.label"></game-text>
119
119
  </div>
120
120
  </template>
@@ -317,12 +317,43 @@
317
317
  "></span>
318
318
  </div>
319
319
  <!-- 物品来源 -->
320
+ <div v-if="source.GetSource" class="u-get-source">
321
+ <span class="u-get-source-header">获取途径:</span>
322
+ <div
323
+ class="u-get-source-list"
324
+ v-for="source in source.GetSource"
325
+ :key="source.label">
326
+ <span class="u-get-source-type"> {{ source.label }} </span>
327
+ <template v-if="source.children">
328
+ <div
329
+ v-for="child in source.children"
330
+ :key="child.label || child">
331
+ <span
332
+ class="u-get-source-child"
333
+ v-if="typeof child === 'string'">
334
+ {{ child }}
335
+ </span>
336
+ <span
337
+ class="u-get-source-child"
338
+ v-else-if="child.label"
339
+ @click="onClickSource(child)"
340
+ :style="sourceStyle(child)"
341
+ :class="{ 'is-link': child.app && child.id }">
342
+ {{ sourceLabel(child) }}
343
+ </span>
344
+ </div>
345
+ </template>
346
+ </div>
347
+ </div>
320
348
  <div
321
- v-if="source.GetType"
349
+ v-else-if="source.GetType"
322
350
  class="u-get-type"
323
351
  v-text="`物品来源:${source.GetType}`"></div>
324
352
  <div
325
- v-if="source.furniture_attributes && source.furniture_attributes.limit"
353
+ v-if="
354
+ source.furniture_attributes &&
355
+ source.furniture_attributes.limit
356
+ "
326
357
  class="u-get-type"
327
358
  v-text="`摆放上限:${source.furniture_attributes.limit}`"></div>
328
359
  </div>
@@ -331,6 +362,7 @@
331
362
 
332
363
  <script>
333
364
  import { get_item } from "../service/item.js";
365
+ import { getLink } from "@jx3box/jx3box-common/js/utils.js";
334
366
 
335
367
  import GameText from "./GameText.vue";
336
368
 
@@ -412,6 +444,26 @@ export default {
412
444
  },
413
445
  },
414
446
  methods: {
447
+ sourceLabel(child) {
448
+ if (typeof child === "string") return child;
449
+ if (child.app == "item") return `[${child.label}]`;
450
+ return child.label;
451
+ },
452
+ sourceStyle(child) {
453
+ if (child.quality)
454
+ return {
455
+ color: color(child.quality),
456
+ };
457
+ return null;
458
+ },
459
+ onClickSource(child) {
460
+ const { app, id } = child;
461
+ if (!app || !id) return;
462
+ const link = getLink(app, id);
463
+ if (link) {
464
+ window.open(link, "_blank");
465
+ }
466
+ },
415
467
  iconLink: function (id) {
416
468
  return iconLink(id, this.final_client);
417
469
  },