@hanzo/ui 8.0.117 → 8.0.118

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.
@@ -23,12 +23,20 @@ exports.place = void 0;
23
23
  * side that already carries one is RE-aligned rather than appended to — so the
24
24
  * result is always a legal placement and applying it twice changes nothing.
25
25
  *
26
- * place('bottom') === 'bottom'
27
- * place('bottom', 'start') === 'bottom-start'
26
+ * An align that is not named does not mean centre. A side arrives already
27
+ * carrying its own alignment whenever the root was given a whole placement, and
28
+ * only a Content that names one has anything to say about it — so the carried
29
+ * suffix survives, and naming `center` is how a caller re-centres on purpose.
30
+ *
31
+ * place('bottom') === 'bottom'
32
+ * place('bottom', 'start') === 'bottom-start'
33
+ * place('bottom-start') === 'bottom-start'
28
34
  * place('bottom-end', 'start') === 'bottom-start'
35
+ * place('bottom-start', 'center') === 'bottom'
29
36
  */
30
- const place = (side, align = 'center') => {
31
- const base = side.split('-')[0];
32
- return align === 'center' ? base : `${base}-${align}`;
37
+ const place = (side, align) => {
38
+ const [base, carried] = side.split('-');
39
+ const named = align ?? carried;
40
+ return !named || named === 'center' ? base : `${base}-${named}`;
33
41
  };
34
42
  exports.place = place;
@@ -24,9 +24,16 @@ export type Align = 'start' | 'center' | 'end';
24
24
  * side that already carries one is RE-aligned rather than appended to — so the
25
25
  * result is always a legal placement and applying it twice changes nothing.
26
26
  *
27
- * place('bottom') === 'bottom'
28
- * place('bottom', 'start') === 'bottom-start'
27
+ * An align that is not named does not mean centre. A side arrives already
28
+ * carrying its own alignment whenever the root was given a whole placement, and
29
+ * only a Content that names one has anything to say about it — so the carried
30
+ * suffix survives, and naming `center` is how a caller re-centres on purpose.
31
+ *
32
+ * place('bottom') === 'bottom'
33
+ * place('bottom', 'start') === 'bottom-start'
34
+ * place('bottom-start') === 'bottom-start'
29
35
  * place('bottom-end', 'start') === 'bottom-start'
36
+ * place('bottom-start', 'center') === 'bottom'
30
37
  */
31
38
  export declare const place: (side: string, align?: Align) => string;
32
39
  //# sourceMappingURL=place.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"place.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/place.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oDAAoD;AACpD,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEtD,gDAAgD;AAChD,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAE9C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,EAAE,QAAO,KAAgB,KAAG,MAG7D,CAAA"}
1
+ {"version":3,"file":"place.d.ts","sourceRoot":"","sources":["../../../src/backends/gui/place.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,oDAAoD;AACpD,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEtD,gDAAgD;AAChD,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAE9C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,EAAE,QAAQ,KAAK,KAAG,MAInD,CAAA"}
@@ -20,12 +20,20 @@
20
20
  * side that already carries one is RE-aligned rather than appended to — so the
21
21
  * result is always a legal placement and applying it twice changes nothing.
22
22
  *
23
- * place('bottom') === 'bottom'
24
- * place('bottom', 'start') === 'bottom-start'
23
+ * An align that is not named does not mean centre. A side arrives already
24
+ * carrying its own alignment whenever the root was given a whole placement, and
25
+ * only a Content that names one has anything to say about it — so the carried
26
+ * suffix survives, and naming `center` is how a caller re-centres on purpose.
27
+ *
28
+ * place('bottom') === 'bottom'
29
+ * place('bottom', 'start') === 'bottom-start'
30
+ * place('bottom-start') === 'bottom-start'
25
31
  * place('bottom-end', 'start') === 'bottom-start'
32
+ * place('bottom-start', 'center') === 'bottom'
26
33
  */
27
- export const place = (side, align = 'center') => {
28
- const base = side.split('-')[0];
29
- return align === 'center' ? base : `${base}-${align}`;
34
+ export const place = (side, align) => {
35
+ const [base, carried] = side.split('-');
36
+ const named = align ?? carried;
37
+ return !named || named === 'center' ? base : `${base}-${named}`;
30
38
  };
31
39
  //# sourceMappingURL=place.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"place.js","sourceRoot":"","sources":["../../../src/backends/gui/place.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,QAAe,QAAQ,EAAU,EAAE;IACrE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IAC/B,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAA;AACvD,CAAC,CAAA"}
1
+ {"version":3,"file":"place.js","sourceRoot":"","sources":["../../../src/backends/gui/place.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,KAAa,EAAU,EAAE;IAC3D,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACvC,MAAM,KAAK,GAAG,KAAK,IAAK,OAA6B,CAAA;IACrD,OAAO,CAAC,KAAK,IAAI,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAA;AACjE,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/ui",
3
- "version": "8.0.117",
3
+ "version": "8.0.118",
4
4
  "type": "module",
5
5
  "description": "Hanzo UI — the one canonical Hanzo component library, on @hanzo/gui + @hanzo/design. ONE substrate: every component renders through @hanzo/gui primitives, so the same import works on web, native (expo) and desktop (Tauri). Self-contained (theme.css), presentational, host-agnostic, clean-room.",
6
6
  "exports": {