pi-kiosk-shared 2.3.10 → 2.3.13

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/README.md CHANGED
@@ -9,7 +9,7 @@ Shared types, API contracts, and error classes for the Pi Kiosk system.
9
9
 
10
10
  ## Temporary retention
11
11
 
12
- `up-backend` keeps production `react` / `react-dom` until cold/start paths consume a Node-safe published or overlaid main barrel. Do **not** drop those deps until that consume path is proven on the version actually installed (registry tarball from `npm view`, or monorepo overlay of sibling `../shared` **2.3.5**). Same caveat as `up-backend/docs/DEPLOYMENT/DEPLOY_SEPARATE_REPOS.md`.
12
+ `up-backend` keeps production `react` / `react-dom` until cold/start paths consume a Node-safe published or overlaid main barrel. Do **not** drop those deps until that consume path is proven on the version actually installed (registry tarball from `npm view`, or monorepo overlay of sibling `../shared` **2.3.10**). Same caveat as `up-backend/docs/DEPLOYMENT/DEPLOY_SEPARATE_REPOS.md`.
13
13
 
14
14
  ## Installation
15
15
 
@@ -74,7 +74,7 @@ Frontends import React modules from `/ui`. The **target** main barrel (local ove
74
74
 
75
75
  ## Local monorepo overlay
76
76
 
77
- **Honesty (SSOT):** Live monorepo source is `shared/package.json` **2.3.5**. All consumers pin **`^2.3.5`** in `package.json`. **Committed locks resolve the npm registry tarball** (`https://registry.npmjs.org/pi-kiosk-shared/-/pi-kiosk-shared-2.3.5.tgz` after refresh) — that is what Railway / app-only `npm ci` installs.
77
+ **Honesty (SSOT):** Live monorepo source is `shared/package.json` **2.3.10**. Monorepo consumers pin **`file:../shared/pi-kiosk-shared-2.3.10.tgz`** (or overlay sibling `../shared`). **Registry / app-only clones** should pin **`^2.3.10`** — versions **< 2.3.10** lack adaptive add-to-cart CQ rules (`.rp-add-cta--always-long`, `@container rp-add-cta` at **14rem**) in `src/tokens/responsive.css`. **Committed locks resolve the npm registry tarball** (`https://registry.npmjs.org/pi-kiosk-shared/-/pi-kiosk-shared-2.3.10.tgz` after refresh) — that is what Railway / app-only `npm ci` installs when not using monorepo overlay.
78
78
 
79
79
  **Local monorepo dev does not use committed tarballs.** When sibling `../shared` exists, `postinstall`/`prepare` → `overlaySharedIfPresent.mjs` → `ensureDist.mjs` copies `shared/dist` into each consumer's `node_modules/pi-kiosk-shared`. You work against live source; registry version in `node_modules` is overwritten on install.
80
80
 
@@ -87,18 +87,20 @@ After every `shared` version bump: `npm publish` (or your release pipeline), the
87
87
 
88
88
  Do **not** commit `file:../shared/pi-kiosk-shared-*.tgz` pins — stale registry locks (e.g. `2.3.2`) ship pre-rewrite outage UI on Railway until locks are refreshed.
89
89
 
90
+ **Monorepo tarball refresh (local):** from `shared/`, run `npm run publish:local` to build and pack `pi-kiosk-shared-<version>.tgz`; reinstall in consumers with `npm install file:../shared/pi-kiosk-shared-<version>.tgz`.
91
+
90
92
  ### Distribution paths
91
93
 
92
94
  | Path | When | How rewrite reaches consumers |
93
95
  |------|------|-------------------------------|
94
96
  | **Local overlay** | Monorepo with sibling `shared/` | `npm ci` / `npm install` hooks → `ensureDist.mjs` |
95
- | **Registry `^2.3.5`** | Railway, app-only clones | `npm ci` → registry tarball from lockfile |
97
+ | **Registry `^2.3.10`** | Railway, app-only clones | `npm ci` → registry tarball from lockfile (≥ 2.3.10 for adaptive-label CSS) |
96
98
 
97
99
  Verify publish contents (maintainers only):
98
100
 
99
101
  ```powershell
100
102
  cd shared; npm run build; npm pack
101
- tar -xOf pi-kiosk-shared-2.3.5.tgz package/dist/components/DatabaseUnavailable.js | Select-String "Aplikace"
103
+ tar -xOf pi-kiosk-shared-2.3.10.tgz package/src/tokens/responsive.css | Select-String "rp-add-cta--always-long"
102
104
  ```
103
105
 
104
106
  **Documented cold path (monorepo):** `npm ci` / `npm install` in each app runs lifecycle hooks → `scripts/overlaySharedIfPresent.mjs` → `shared/scripts/ensureDist.mjs` when sibling `../shared` exists:
@@ -136,7 +138,7 @@ npm run gate:main-barrel-node-safe
136
138
 
137
139
  From `shared/`, prove the documented cold path:
138
140
 
139
- 1. **DIAGNOSTIC** — `npm pack` a known Node-safe registry tarball (`COLD_VERSION` in `prove-pi-kiosk-shared-cold-overlay.mjs`, currently `2.2.82` — intentional historical diagnostic fixture, not the live pin) in a temp dir and assert COLD_BAD markers (never installs into a consumer with `--ignore-scripts`). Live monorepo source is `shared/package.json` **2.3.5**.
141
+ 1. **DIAGNOSTIC** — `npm pack` a known Node-safe registry tarball (`COLD_VERSION` in `prove-pi-kiosk-shared-cold-overlay.mjs`, currently `2.2.82` — intentional historical diagnostic fixture, not the live pin) in a temp dir and assert COLD_BAD markers (never installs into a consumer with `--ignore-scripts`). Live monorepo source is `shared/package.json` **2.3.10**.
140
142
  2. **PASS** — wipe that consumer’s `node_modules/pi-kiosk-shared`, then `npm install` with **scripts on** (no package args) so `prepare` / `postinstall` overlays during install; assert Node-safe barrel + `NODE_IMPORT_OK`.
141
143
 
142
144
  ```bash
@@ -11,9 +11,20 @@ export type LogoChipMarkResolvedChrome = {
11
11
  /** Where the square mark appears — shadow treatment differs on login hero only. */
12
12
  export type LogoChipMarkStyleVariant = 'orgPicker' | 'loginHero';
13
13
  export type LogoChipMarkInlineStyle = Record<string, string>;
14
+ export type LogoChipMarkPartitionedStyles = {
15
+ readonly shell: LogoChipMarkInlineStyle | undefined;
16
+ readonly fill: LogoChipMarkInlineStyle | undefined;
17
+ };
14
18
  /**
15
19
  * Inline styles for logo chip rim + background fill.
16
20
  * SSOT for admin org picker, login hero, and branding previews.
17
21
  */
18
22
  export declare function buildLogoChipMarkStyle(resolved: LogoChipMarkResolvedChrome, variant?: LogoChipMarkStyleVariant): LogoChipMarkInlineStyle | undefined;
23
+ /**
24
+ * Rim (box-shadow) on the outer shell; background fill on an inner layer.
25
+ * Prevents the background colour picker from appearing to recolour the rim when both are on.
26
+ */
27
+ export declare function partitionLogoChipMarkStyle(resolved: LogoChipMarkResolvedChrome, variant?: LogoChipMarkStyleVariant): LogoChipMarkPartitionedStyles;
28
+ /** Partition a combined {@link buildLogoChipMarkStyle} result when background is enabled. */
29
+ export declare function partitionLogoChipMarkInlineStyle(style: LogoChipMarkInlineStyle | undefined, showBackground: boolean): LogoChipMarkPartitionedStyles;
19
30
  //# sourceMappingURL=logoChipMarkStyle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logoChipMarkStyle.d.ts","sourceRoot":"","sources":["../../src/branding/logoChipMarkStyle.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,CAAC,GAAG,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,QAAQ,CAAC,UAAU,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACzE,CAAC;AAEF,mFAAmF;AACnF,MAAM,MAAM,wBAAwB,GAAG,WAAW,GAAG,WAAW,CAAC;AAEjE,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,0BAA0B,EACpC,OAAO,GAAE,wBAAsC,GAC9C,uBAAuB,GAAG,SAAS,CAqBrC"}
1
+ {"version":3,"file":"logoChipMarkStyle.d.ts","sourceRoot":"","sources":["../../src/branding/logoChipMarkStyle.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,CAAC,GAAG,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACjE,QAAQ,CAAC,UAAU,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CACzE,CAAC;AAEF,mFAAmF;AACnF,MAAM,MAAM,wBAAwB,GAAG,WAAW,GAAG,WAAW,CAAC;AAEjE,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE7D,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,CAAC,KAAK,EAAE,uBAAuB,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,IAAI,EAAE,uBAAuB,GAAG,SAAS,CAAC;CACpD,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,0BAA0B,EACpC,OAAO,GAAE,wBAAsC,GAC9C,uBAAuB,GAAG,SAAS,CAqBrC;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,0BAA0B,EACpC,OAAO,GAAE,wBAAsC,GAC9C,6BAA6B,CAyB/B;AAED,6FAA6F;AAC7F,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,uBAAuB,GAAG,SAAS,EAC1C,cAAc,EAAE,OAAO,GACtB,6BAA6B,CA6B/B"}
@@ -23,4 +23,54 @@ export function buildLogoChipMarkStyle(resolved, variant = 'orgPicker') {
23
23
  }
24
24
  return style;
25
25
  }
26
+ /**
27
+ * Rim (box-shadow) on the outer shell; background fill on an inner layer.
28
+ * Prevents the background colour picker from appearing to recolour the rim when both are on.
29
+ */
30
+ export function partitionLogoChipMarkStyle(resolved, variant = 'orgPicker') {
31
+ if (!resolved.background.show) {
32
+ return { shell: buildLogoChipMarkStyle(resolved, variant), fill: undefined };
33
+ }
34
+ const fill = {
35
+ '--logo-chip-background': resolved.background.color,
36
+ backgroundColor: 'var(--logo-chip-background)',
37
+ backgroundImage: 'none',
38
+ };
39
+ if (!resolved.rim.show) {
40
+ return { shell: undefined, fill };
41
+ }
42
+ return {
43
+ shell: buildLogoChipMarkStyle({
44
+ rim: resolved.rim,
45
+ background: { show: false, color: resolved.background.color },
46
+ }, variant),
47
+ fill,
48
+ };
49
+ }
50
+ /** Partition a combined {@link buildLogoChipMarkStyle} result when background is enabled. */
51
+ export function partitionLogoChipMarkInlineStyle(style, showBackground) {
52
+ if (!style || !showBackground) {
53
+ return { shell: style, fill: undefined };
54
+ }
55
+ const fill = {};
56
+ if (style['--logo-chip-background'] != null) {
57
+ fill['--logo-chip-background'] = style['--logo-chip-background'];
58
+ }
59
+ if (style.backgroundColor != null) {
60
+ fill.backgroundColor = style.backgroundColor;
61
+ }
62
+ if (style.backgroundImage != null) {
63
+ fill.backgroundImage = style.backgroundImage;
64
+ }
65
+ const shell = { ...style };
66
+ delete shell['--logo-chip-background'];
67
+ delete shell.backgroundColor;
68
+ delete shell.backgroundImage;
69
+ const hasShell = shell.boxShadow != null
70
+ || shell['--logo-chip-rim'] != null;
71
+ return {
72
+ shell: hasShell ? shell : undefined,
73
+ fill,
74
+ };
75
+ }
26
76
  //# sourceMappingURL=logoChipMarkStyle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logoChipMarkStyle.js","sourceRoot":"","sources":["../../src/branding/logoChipMarkStyle.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAoC,EACpC,UAAoC,WAAW;IAE/C,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;IAClC,MAAM,cAAc,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;QAChC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,KAAK,GAA4B,EAAE,CAAC;IAC1C,IAAI,OAAO,EAAE,CAAC;QACZ,KAAK,CAAC,iBAAiB,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;QAC9C,KAAK,CAAC,SAAS;YACb,OAAO,KAAK,WAAW;gBACrB,CAAC,CAAC,6DAA6D;gBAC/D,CAAC,CAAC,gCAAgC,CAAC;IACzC,CAAC;IACD,IAAI,cAAc,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K,CAAC,eAAe,CAAC;IAC/C,CAAC;IAED,MAAM,KAAK,GAA4B,EAAE,GAAG,KAAK,EAAE,CAAC;IACpD,OAAO,KAAK,CAAC,wBAAwB,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,eAAe,CAAC;IAC7B,OAAO,KAAK,CAAC,eAAe,CAAC;IAE7B,MAAM,QAAQ,GACZ,KAAK,CAAC,SAAS,IAAI,IAAI;WACpB,KAAK,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC;IAEtC,OAAO;QACL,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QACnC,IAAI;KACL,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-kiosk-shared",
3
- "version": "2.3.10",
3
+ "version": "2.3.13",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Shared types, API contracts, and error classes for Pi Kiosk system",
@@ -92,3 +92,44 @@
92
92
  }
93
93
  }
94
94
  }
95
+
96
+ /**
97
+ * Adaptive add-to-cart CTA copy — long label when the inner frame is wide enough,
98
+ * short label in narrow 2-col browse card cells. Parent button must be block/w-full;
99
+ * AdaptiveAddToCartLabel renders the `.rp-add-cta` frame inside the button.
100
+ *
101
+ * Threshold 14rem: ~390px viewport 2-col action cells (~175px) stay short; full-width
102
+ * detail footer uses `.rp-add-cta--always-long` instead of CQ.
103
+ */
104
+ .rp-add-cta {
105
+ container-type: inline-size;
106
+ container-name: rp-add-cta;
107
+ }
108
+
109
+ .rp-add-cta-label-long {
110
+ display: none;
111
+ }
112
+
113
+ .rp-add-cta-label-short {
114
+ display: inline;
115
+ }
116
+
117
+ .rp-add-cta--always-long .rp-add-cta-label-long {
118
+ display: inline;
119
+ }
120
+
121
+ .rp-add-cta--always-long .rp-add-cta-label-short {
122
+ display: none;
123
+ }
124
+
125
+ @supports (container-type: inline-size) {
126
+ @container rp-add-cta (min-width: 14rem) {
127
+ .rp-add-cta:not(.rp-add-cta--always-long) .rp-add-cta-label-long {
128
+ display: inline;
129
+ }
130
+
131
+ .rp-add-cta:not(.rp-add-cta--always-long) .rp-add-cta-label-short {
132
+ display: none;
133
+ }
134
+ }
135
+ }