@7365admin1/layer-common 4.97.1-staging.702 → 4.97.1-staging.703

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.
@@ -115,7 +115,7 @@
115
115
  </tr>
116
116
  </tbody>
117
117
  </v-table>
118
- <v-alert v-if="isBlank && design.shape !== 'square' && design.text === 'none'" type="warning" variant="tonal"
118
+ <v-alert v-if="isBlank && design.blankCode !== 'hide' && design.shape !== 'square' && design.text === 'none'" type="warning" variant="tonal"
119
119
  density="compact" class="my-2" data-test="vehicle-qr-blank-notext">
120
120
  With "No text" nothing is printed under the shape - neither the sticker's code nor its number - so these stickers
121
121
  can only be linked by scanning them with iMA365 / iSecure365. Pick another Text option to print it.
@@ -125,9 +125,8 @@
125
125
  {{ blankWithoutNumber }} sticker(s) have no sticker number, so their long code is still printed on them.
126
126
  </v-alert>
127
127
  <p v-if="isBlank && design.blankCode === 'hide'" class="text-caption text-medium-emphasis my-2">
128
- Each sticker has a cut-off strip under the dashed line saying it is not linked yet - cut it off before pasting
129
- the sticker on the car. To link one, pick its sticker number in Vehicles &gt; Link QR sticker, or scan it with
130
- iMA365 / iSecure365.
128
+ Each sticker prints only the QR code and its sticker number. To link one, pick its sticker number in
129
+ Vehicles &gt; Link QR sticker (or when adding a vehicle), or scan it with iMA365 / iSecure365.
131
130
  </p>
132
131
  <p v-else-if="isBlank" class="text-caption text-medium-emphasis my-2">
133
132
  Each sticker has a cut-off strip under the dashed line saying it is not linked yet - cut it off before pasting
@@ -174,16 +173,16 @@
174
173
  <v-select v-model="design.theme" :items="STICKER_THEMES" item-value="id" label="Colours" density="compact"
175
174
  hide-details />
176
175
  </v-col>
177
- <v-col v-if="design.shape !== 'square'" cols="12" sm="6" md="4">
176
+ <v-col v-if="design.shape !== 'square' && !blankQrSerialOnly" cols="12" sm="6" md="4">
178
177
  <v-select v-model="design.text" :items="TEXT_OPTIONS" label="Text" density="compact" hide-details
179
178
  data-test="vehicle-qr-text" />
180
179
  </v-col>
181
- <v-col v-if="design.shape === 'square' || design.text !== 'none'" cols="12" sm="6" md="4">
180
+ <v-col v-if="(design.shape === 'square' || design.text !== 'none') && !blankQrSerialOnly" cols="12" sm="6" md="4">
182
181
  <v-select v-model="design.label" :items="LABEL_OPTIONS"
183
182
  :label="design.plate === 'hide' ? 'Words on the sticker' : 'Words under the plate'" density="compact"
184
183
  hide-details />
185
184
  </v-col>
186
- <v-col cols="12" sm="6" md="4">
185
+ <v-col v-if="!blankQrSerialOnly" cols="12" sm="6" md="4">
187
186
  <v-select v-model="design.serial" :items="SERIAL_OPTIONS" label="Serial number" density="compact"
188
187
  hide-details data-test="vehicle-qr-serial" />
189
188
  </v-col>
@@ -203,6 +202,8 @@
203
202
  <div class="d-flex align-center flex-wrap">
204
203
  <v-switch v-model="design.cutLines" label="Show cut lines" color="primary" density="compact" hide-details
205
204
  inset class="mt-1 mr-4" data-test="vehicle-qr-cut-lines" />
205
+ <v-btn variant="tonal" color="primary" size="small" class="text-none mr-2" data-test="vehicle-qr-qr-serial-only"
206
+ @click="qrSerialOnly">QR + serial number only</v-btn>
206
207
  <v-btn variant="text" size="small" class="text-none" @click="resetDesign">Back to the standard look</v-btn>
207
208
  </div>
208
209
  <v-alert type="warning" variant="tonal" density="compact" class="mt-2" data-test="vehicle-qr-size-info">
@@ -371,9 +372,15 @@ const siteName = ref("");
371
372
  const DESIGN_KEY = "vehicleQrStickerDesign";
372
373
  // The serial choice is kept on its own, only when the person picks it.
373
374
  const SERIAL_KEY = "vehicleQrStickerSerial";
375
+ // Likewise the long-code choice (its default changed to "hide" on 17 Nov 2026).
376
+ const BLANK_CODE_KEY = "vehicleQrStickerBlankCode";
374
377
  function loadDesign(): StickerDesign {
375
378
  try {
376
- return rememberedDesign(JSON.parse(localStorage.getItem(DESIGN_KEY) || "null"), localStorage.getItem(SERIAL_KEY));
379
+ return rememberedDesign(
380
+ JSON.parse(localStorage.getItem(DESIGN_KEY) || "null"),
381
+ localStorage.getItem(SERIAL_KEY),
382
+ localStorage.getItem(BLANK_CODE_KEY),
383
+ );
377
384
  } catch {
378
385
  return { ...DEFAULT_STICKER_DESIGN };
379
386
  }
@@ -396,9 +403,25 @@ watch(
396
403
  }
397
404
  },
398
405
  );
406
+ watch(
407
+ () => design.blankCode,
408
+ (b) => {
409
+ try {
410
+ localStorage.setItem(BLANK_CODE_KEY, String(b));
411
+ } catch {
412
+ /* not saved - nothing else to do */
413
+ }
414
+ },
415
+ );
399
416
  function resetDesign() {
400
417
  Object.assign(design, DEFAULT_STICKER_DESIGN);
401
418
  }
419
+ // Blank stickers printing only the QR and the number: text, words and serial place do not apply.
420
+ const blankQrSerialOnly = computed(() => isBlank.value && design.blankCode === "hide");
421
+ /** One click: the QR code and the serial number, nothing else (blank and vehicle stickers alike). */
422
+ function qrSerialOnly() {
423
+ Object.assign(design, { blankCode: "hide", plate: "hide", serial: "sticker", label: "none", text: "below" });
424
+ }
402
425
 
403
426
  // A small live picture of every QR shape in the current dots / corners / colours.
404
427
  const SAMPLE = "HTTPS://APP.ISERVICE365.ORG/Q/SamplePreviewToken0000";
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@7365admin1/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "4.97.1-staging.702",
5
+ "version": "4.97.1-staging.703",
6
6
  "author": "7365admin1",
7
7
  "main": "./nuxt.config.ts",
8
8
  "//files": "What a consumer extending this layer actually loads. Without this npm ships the whole working tree - the changesets, the CI workflows, the render harness in tools/ and any scratch directory that happened to exist at publish time. Nuxt resolves a layer by directory, so every runtime directory below has to stay listed; adding a new top-level runtime directory means adding it here too.",
@@ -158,8 +158,8 @@ export const PLATE_OPTIONS: { value: PlateChoice; title: string }[] = [
158
158
  ];
159
159
 
160
160
  export const BLANK_CODE_OPTIONS: { value: BlankCodeChoice; title: string }[] = [
161
- { value: "print", title: "Print (default)" },
162
- { value: "hide", title: "Hide - QR code and sticker number only" },
161
+ { value: "hide", title: "Hide - QR code and sticker number only (default)" },
162
+ { value: "print", title: "Print the long code too" },
163
163
  ];
164
164
 
165
165
  export const LABEL_OPTIONS: { value: LabelChoice; title: string }[] = [
@@ -193,7 +193,8 @@ export const DEFAULT_STICKER_DESIGN: StickerDesign = {
193
193
  cutLines: true,
194
194
  serial: "sticker",
195
195
  plate: "show",
196
- blankCode: "print",
196
+ // Client ask (TLR, 17 Nov 2026): blank stickers print the QR and the sticker number only.
197
+ blankCode: "hide",
197
198
  };
198
199
 
199
200
  /** A saved or typed-in design with anything unknown replaced by the default. */
@@ -227,9 +228,10 @@ export function normalizeDesign(raw: unknown): StickerDesign {
227
228
  * change, so a saved serial of "off" may only be the old default; the serial
228
229
  * choice counts only when it was saved on its own (the person picked it).
229
230
  */
230
- export function rememberedDesign(saved: unknown, savedSerial: unknown): StickerDesign {
231
+ export function rememberedDesign(saved: unknown, savedSerial: unknown, savedBlankCode?: unknown): StickerDesign {
231
232
  const r = saved && typeof saved === "object" ? (saved as Record<string, unknown>) : {};
232
- return normalizeDesign({ ...r, serial: savedSerial });
233
+ // Same for the long code: a saved "print" may only be the old default.
234
+ return normalizeDesign({ ...r, serial: savedSerial, blankCode: savedBlankCode });
233
235
  }
234
236
 
235
237
  /**
@@ -237,9 +239,12 @@ export function rememberedDesign(saved: unknown, savedSerial: unknown): StickerD
237
239
  * code whose tab under the shape would be left empty (no serial or words on
238
240
  * it) is printed with no tab, so no bare paper tab hangs under the shape.
239
241
  * Blank stickers always print their code or sticker number in the tab, so they keep it.
242
+ * Blank stickers with the long code hidden print the QR and the sticker number
243
+ * only: no extra words, and a shaped code always gets its tab for the number.
240
244
  */
241
245
  export function printedDesign(design: unknown, blank = false, siteName = ""): StickerDesign {
242
246
  const d = normalizeDesign(design);
247
+ if (blank && d.blankCode === "hide") return { ...d, label: "none", text: "below" };
243
248
  const tabEmpty = d.serial !== "sticker" && d.serial !== "both" && !stickerLabel(d, siteName);
244
249
  return !blank && d.plate === "hide" && isSilhouette(d.shape) && d.text === "below" && tabEmpty ? { ...d, text: "none" } : d;
245
250
  }
@@ -449,6 +449,11 @@ function cardContext(design: StickerDesign, siteName: string | undefined, n: num
449
449
  };
450
450
  }
451
451
 
452
+ /** "QR + serial number only": nothing but the number under the code (no words, no Seven365 line). */
453
+ function qrAndSerialOnly(item: StickerItem, c: CardContext): boolean {
454
+ return !c.label && (blankCodeHidden(item, c) || (!item.blank && c.hidePlate));
455
+ }
456
+
452
457
  /** The sticker itself (frame + QR + plate words) - what goes on the car. */
453
458
  function cardHtml(item: StickerItem, face: string, c: CardContext): string {
454
459
  const { lines, serialText } = headLines(item, c);
@@ -470,7 +475,7 @@ function cardHtml(item: StickerItem, face: string, c: CardContext): string {
470
475
  (lines.length ? `<div class="plate"${lines.length > 1 || blankCodeHidden(item, c) ? ` style="font-size:${plateSizeMm(longest, c.cardW - 6, 4.6)}mm"` : ""}>${plate}</div>` : "") +
471
476
  serial +
472
477
  label +
473
- `<div class="brand"><span class="mark" style="background:${c.ink}">7</span>Powered by Seven365</div>` +
478
+ (qrAndSerialOnly(item, c) ? "" : `<div class="brand"><span class="mark" style="background:${c.ink}">7</span>Powered by Seven365</div>`) +
474
479
  `</div>`;
475
480
  return `<div class="card" style="color:${c.ink}"><div class="face">${face}</div>${words}</div>`;
476
481
  }
@@ -495,7 +500,10 @@ export function buildStickerDocument(
495
500
  const { place, owner } = installerLine(item);
496
501
  const [noteHead, noteRest] = blankStripNote(item, design).split(" - ");
497
502
  const sn = stripSerial(item) ? `<span class="sn">${escapeHtml(stickerSerial(item))}</span>` : "";
498
- const strip = item.blank
503
+ // QR + number only: the strip stays blank (the number is on the sticker; link it by that number)
504
+ const strip = blankCodeHidden(item, design)
505
+ ? `<div class="cut${c.bare ? " free" : ""} blank"></div>`
506
+ : item.blank
499
507
  ? `<div class="cut${c.bare ? " free" : ""} blank"><div>${sn}<b>${escapeHtml(noteHead)}</b></div><div>${escapeHtml(noteRest)}</div></div>`
500
508
  : `<div class="cut${c.bare ? " free" : ""}"><div>${sn}<b>${escapeHtml(place || "-")}</b></div><div class="owner">Owner: ${escapeHtml(owner || "-")}</div></div>`;
501
509
  return (
@@ -554,6 +562,8 @@ function cardWordsSvg(item: StickerItem, c: CardContext): string {
554
562
  } else {
555
563
  if (serialText) rows.push(word(serialText, true));
556
564
  if (label) rows.push(word(label, false));
565
+ }
566
+ if (!c.tag && !qrAndSerialOnly(item, c)) {
557
567
  // the Seven365 line: grey rule, the ink "7" mark and the words, centred together
558
568
  const textW = 10.061 * 6 * PT;
559
569
  const groupW = 3.2 + 1 + textW;