dsh-plugin-infj-pet 1.0.4 → 1.0.5

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/CHANGELOG.md CHANGED
@@ -3,6 +3,38 @@
3
3
  All notable changes to this plugin are documented here. This project follows
4
4
  [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## 1.0.5
7
+
8
+ **The character and its speech bubble line up**
9
+
10
+ - The box that carries the character was not the size of the character: it
11
+ reserved a ground gap as height while the sprite pushed itself up by the same
12
+ amount as a bottom margin. The visible pixels therefore sat above the box's
13
+ bottom edge, so the sage looked off-centre while the bubble, anchored to the
14
+ box, sat opposite it. The box is now exactly the artwork, and the ground
15
+ clearance is padding on the container — the drawing and the box agree, so the
16
+ speech is centred on the character at every size.
17
+ - The five pixels of horizontal margin that widened the box have gone for the
18
+ same reason.
19
+
20
+ **The bubble is sized to the character**
21
+
22
+ - The bubble was a fixed 250 px at every scale, which crowded a large sage and
23
+ wasted space on a small one. It is now two and a half times the character's own
24
+ width: about 292 px small, 585 px medium, 878 px large, still clamped to the
25
+ viewport so it cannot overflow a narrow window.
26
+
27
+ **Citations name the book**
28
+
29
+ - Quotations are attributed by title only — 《务虚笔记》, 《我与地坛》,
30
+ 《病隙碎笔》, 《命若琴弦》 — because the title is what a reader needs in order
31
+ to find the passage. The author's name no longer appears in the interface; it
32
+ remains in the licence notice, where attribution belongs.
33
+ - The reading line supplied by the project owner is now attributed to
34
+ 《务虚笔记》, which resolves the source that 1.0.2 had recorded as unidentified.
35
+ The edition is still unpinned and the README says so rather than implying more
36
+ certainty than exists.
37
+
6
38
  ## 1.0.4
7
39
 
8
40
  **Fix: the plugin never activated**
package/README.md CHANGED
@@ -55,23 +55,26 @@ Around that core:
55
55
 
56
56
  This is an **in-window** companion, not an operating-system desktop overlay.
57
57
 
58
- ### Words borrowed from 史铁生 (Shi Tiesheng)
58
+ ### Quoted lines
59
59
 
60
- Several of the reading lines are his, and the sage is careful to say so: a
61
- quoted line renders its attribution directly under the text, in a smaller line,
62
- never as if the sage had written it.
60
+ Several reading lines are short quotations, attributed in the interface under the
61
+ line they belong to — the speech bubble cites the book, and this page records the
62
+ full source. They are brief, individually attributed, and used in a
63
+ non-commercial companion; the project claims no rights in them.
63
64
 
64
65
  | Line | Source |
65
66
  |---|---|
66
- | 如果我进来,走进你独处的时间……我只是来给你的窗上装好玻璃,冬天的风就要来了。 | 史铁生 — supplied by the project owner; publication not yet identified |
67
- | 死是一件不必急于求成的事。 | 史铁生《我与地坛》 |
68
- | 太阳,他每时每刻都是夕阳也都是旭日。 | 史铁生《我与地坛》 |
69
- | 我常觉得这中间有着宿命的味道。 | 史铁生《我与地坛》 |
70
-
71
- Where a line could not be verified against a published source, this project says
72
- so rather than presenting a guess as a quotation — the first row above is
73
- recorded as unverified for exactly that reason. Titles are referenced for the
74
- remaining states; no passage is reproduced beyond the short lines listed here.
67
+ | 如果我进来,走进你独处的时间……我只是来给你的窗上装好玻璃,冬天的风就要来了。 | 《务虚笔记》 — named by the project owner; edition not yet pinned |
68
+ | 死是一件不必急于求成的事。 | 《我与地坛》 |
69
+ | 太阳,他每时每刻都是夕阳也都是旭日。 | 《我与地坛》 |
70
+ | 我常觉得这中间有着宿命的味道。 | 《我与地坛》 |
71
+
72
+ The sage cites the book, not the author's name: the title is what a reader needs
73
+ to find the passage, and it keeps the attribution to a fact rather than a
74
+ byline. Where a line could not be checked against a published edition, this
75
+ project says so — the first row above is recorded that way rather than being
76
+ presented as confirmed. Titles are referenced for the remaining states; no
77
+ passage is reproduced beyond the short lines listed here.
75
78
 
76
79
  ---
77
80
 
package/lib/client.js CHANGED
@@ -127,12 +127,12 @@ window.__ModuleLoader__.load({
127
127
  {
128
128
  zh: '死是一件不必急于求成的事。',
129
129
  en: 'Dying is a thing that need not be hurried.',
130
- source: { zh: '史铁生《我与地坛》', en: 'Shi Tiesheng, "The Ditan and I"' }
130
+ source: { zh: '《我与地坛》', en: '"The Ditan and I"' }
131
131
  },
132
132
  {
133
133
  zh: '太阳,他每时每刻都是夕阳也都是旭日。',
134
134
  en: 'The sun is, at every moment, both the setting sun and the rising one.',
135
- source: { zh: '史铁生《我与地坛》', en: 'Shi Tiesheng, "The Ditan and I"' }
135
+ source: { zh: '《我与地坛》', en: '"The Ditan and I"' }
136
136
  },
137
137
  { zh: '我在,不急。', en: 'I am here. No rush.' }
138
138
  ],
@@ -142,7 +142,7 @@ window.__ModuleLoader__.load({
142
142
  {
143
143
  zh: '病隙里也有碎笔。',
144
144
  en: 'Fragments get written in the gaps between being ill.',
145
- source: { zh: '史铁生《病隙碎笔》', en: 'Shi Tiesheng, "Notes Written in the Gaps"' }
145
+ source: { zh: '《病隙碎笔》', en: '"Notes Written in the Gaps"' }
146
146
  }
147
147
  ],
148
148
  waiting: [
@@ -154,24 +154,24 @@ window.__ModuleLoader__.load({
154
154
  {
155
155
  zh: '命若琴弦,先别急着弹断它。',
156
156
  en: 'Life is like a string on the qin — do not rush to play it through.',
157
- source: { zh: '史铁生《命若琴弦》', en: 'Shi Tiesheng, "Life Is Like a String"' }
157
+ source: { zh: '《命若琴弦》', en: '"Life Is Like a String"' }
158
158
  }
159
159
  ],
160
160
  reading: [
161
161
  {
162
162
  zh: '如果我进来,走进你独处的时间,你只管你的沉思默想,不不,你不要慌忙起来,对,你想怎样待着就怎样待着,我只是来给你的窗上装好玻璃,冬天的风就要来了。',
163
163
  en: 'If I come in, into your private hour — go on with your thinking, no, do not get up in a hurry, yes, stay however you like. I have only come to fit the glass in your window. The winter wind is on its way.',
164
- source: { zh: '史铁生', en: 'Shi Tiesheng' }
164
+ source: { zh: '《务虚笔记》', en: '"Notes on a Fiction"' }
165
165
  },
166
166
  {
167
167
  zh: '太阳,他每时每刻都是夕阳也都是旭日。',
168
168
  en: 'The sun is, at every moment, both the setting sun and the rising one.',
169
- source: { zh: '史铁生《我与地坛》', en: 'Shi Tiesheng, "The Ditan and I"' }
169
+ source: { zh: '《我与地坛》', en: '"The Ditan and I"' }
170
170
  },
171
171
  {
172
172
  zh: '死是一件不必急于求成的事。',
173
173
  en: 'Dying is a thing that need not be hurried.',
174
- source: { zh: '史铁生《我与地坛》', en: 'Shi Tiesheng, "The Ditan and I"' }
174
+ source: { zh: '《我与地坛》', en: '"The Ditan and I"' }
175
175
  }
176
176
  ],
177
177
  sleeping: [
@@ -185,7 +185,7 @@ window.__ModuleLoader__.load({
185
185
  {
186
186
  zh: '我常觉得这中间有着宿命的味道。',
187
187
  en: 'I have often felt there was something of fate in all of it.',
188
- source: { zh: '史铁生《我与地坛》', en: 'Shi Tiesheng, "The Ditan and I"' }
188
+ source: { zh: '《我与地坛》', en: '"The Ditan and I"' }
189
189
  }
190
190
  ]
191
191
  };
@@ -454,18 +454,20 @@ window.__ModuleLoader__.load({
454
454
 
455
455
  var scale = opts.scale || 1;
456
456
  var art = SP.stage.art;
457
- var marginX = 12;
458
- var marginY = 8;
459
- // The box frames the artwork rather than the whole cell, so the sage is not
460
- // surrounded by the sheet's empty margin. Everything is an integer multiple
461
- // of the source pixels so nothing is resampled.
457
+ // The box is exactly the artwork, with no slop: any margin here would sit
458
+ // between the visible pixels and the box edge, and the bubble is anchored to
459
+ // the box, so the character would look offset from its own speech. The sheet's
460
+ // empty cell margin is already trimmed by using the measured art box, and
461
+ // everything stays an integer multiple of the source pixels so nothing is
462
+ // resampled. The little clearance under the feet is CSS padding on the
463
+ // container, which keeps the layout and the drawing in agreement.
462
464
  return {
463
- width: (art.width + marginX) * scale,
464
- height: (art.height + marginY) * scale,
465
+ width: art.width * scale,
466
+ height: art.height * scale,
465
467
  backgroundSize: SP.sheet.width * scale + 'px ' + SP.sheet.height * scale + 'px',
466
468
  backgroundPosition: -Math.round(cell[0] * scale) + 'px ' + -Math.round(cell[1] * scale) + 'px',
467
- // How far the artwork's ground line sits above the box's bottom edge.
468
- bottomInset: (SP.stage.ground - (art.y + art.height) + marginY) * scale
469
+ // The ground line is the artwork's last row, so nothing hangs below it.
470
+ groundGap: (SP.stage.ground - (art.y + art.height)) * scale
469
471
  };
470
472
  }
471
473
 
@@ -712,7 +714,11 @@ window.__ModuleLoader__.load({
712
714
  '.infj-sprite{image-rendering:pixelated;image-rendering:crisp-edges;background-repeat:no-repeat;',
713
715
  'transform-origin:bottom center;transition:transform .16s ease-out}',
714
716
  '.infj-pet.is-poked .infj-sprite{transform:scale(1.06)}',
715
- '.infj-bubble{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);max-width:250px;',
717
+ // The bubble is anchored to the box, so its width is derived from the box
718
+ // rather than fixed: a larger sage gets a proportionally larger bubble, and
719
+ // the wrap stays comfortable at every size.
720
+ '.infj-bubble{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);',
721
+ 'box-sizing:border-box;width:calc(var(--s-bubble) * 2.5);max-width:min(88vw,var(--s-bubble) * 2.5);',
716
722
  'min-width:72px;padding:8px 12px;border-radius:14px;background:var(--s-panel);color:var(--s-ink);',
717
723
  'font-size:12.5px;font-weight:500;box-shadow:0 6px 22px rgba(16,34,16,0.18),0 1px 0 rgba(255,255,255,0.5) inset;',
718
724
  'border:1px solid var(--s-chip);pointer-events:none;animation:infj-bubble-in .22s ease-out;text-align:center;',
@@ -1002,8 +1008,11 @@ window.__ModuleLoader__.load({
1002
1008
  }) || SIZES[1];
1003
1009
  var scale = size.scale;
1004
1010
  var art = SP.stage.art;
1005
- var boxWidth = (art.width + 12) * scale;
1006
- var boxHeight = (art.height + 8) * scale;
1011
+ // The box is the artwork itself; the sheet's own ground gap becomes padding
1012
+ // below it so the character is centred both ways inside its own box.
1013
+ var groundGap = (SP.stage.ground - (art.y + art.height)) * scale;
1014
+ var boxWidth = art.width * scale;
1015
+ var boxHeight = art.height * scale + groundGap;
1007
1016
 
1008
1017
  var rootRef = React.useRef(null);
1009
1018
  var dragRef = React.useRef(null);
@@ -1284,6 +1293,11 @@ window.__ModuleLoader__.load({
1284
1293
  var style = {
1285
1294
  width: boxWidth + 'px',
1286
1295
  height: boxHeight + 'px',
1296
+ // The bubble derives its width from the character's own size, so a
1297
+ // larger sage gets a proportionally larger bubble instead of the same
1298
+ // cramped box at every scale.
1299
+ '--s-bubble': boxWidth + 'px',
1300
+ paddingBottom: groundGap + 'px',
1287
1301
  left: position.x == null ? undefined : position.x + 'px',
1288
1302
  top: position.y == null ? undefined : position.y + 'px',
1289
1303
  right: position.x == null ? '24px' : undefined,
@@ -1344,8 +1358,7 @@ window.__ModuleLoader__.load({
1344
1358
  backgroundSize: spec.backgroundSize,
1345
1359
  backgroundPosition: spec.backgroundPosition,
1346
1360
  width: spec.width + 'px',
1347
- height: spec.height + 'px',
1348
- marginBottom: spec.bottomInset + 'px'
1361
+ height: spec.height + 'px'
1349
1362
  }
1350
1363
  })
1351
1364
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-infj-pet",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "INFJ Sage — a pixel-art Advocate/Counselor companion that lives in your DSH window and reflects what your agents are doing.",
5
5
  "keywords": [
6
6
  "dsh",