@khanacademy/wonder-blocks-layout 3.1.48 → 3.1.50

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
@@ -1,5 +1,29 @@
1
1
  # @khanacademy/wonder-blocks-layout
2
2
 
3
+ ## 3.1.50
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [245229a]
8
+ - @khanacademy/wonder-blocks-tokens@16.4.1
9
+
10
+ ## 3.1.49
11
+
12
+ ### Patch Changes
13
+
14
+ - 0fadf9f: Migrate internal usage of the deprecated `spacing` primitive token to the
15
+ `sizing` token. No public API or visual changes — each `spacing.<name>`
16
+ value maps 1:1 to a `sizing.size_<n>` token with the same rendered value.
17
+ A handful of internal `Strut` usages are replaced with CSS `gap` /
18
+ `margin` (since `sizing.X` is a CSS variable string at runtime, not a
19
+ number). Layout-spec and SVG sites that genuinely need JS numbers use
20
+ hardcoded values that mirror the matching `sizing.size_*` tokens (with
21
+ comments). Prep for removal of the `spacing` export in a future major
22
+ release of `@khanacademy/wonder-blocks-tokens`.
23
+ - Updated dependencies [c1c74df]
24
+ - Updated dependencies [72c5272]
25
+ - @khanacademy/wonder-blocks-tokens@16.4.0
26
+
3
27
  ## 3.1.48
4
28
 
5
29
  ### Patch Changes
package/dist/es/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
3
  import { InitialFallback, View } from '@khanacademy/wonder-blocks-core';
4
- import { spacing } from '@khanacademy/wonder-blocks-tokens';
4
+ import { remToPx, tokenValue, sizing } from '@khanacademy/wonder-blocks-tokens';
5
5
  import { StyleSheet } from 'aphrodite';
6
6
 
7
- const VALID_MEDIA_SIZES=["small","medium","large"];const mediaDefaultSpecLargeMarginWidth=spacing.large_24;const MEDIA_DEFAULT_SPEC={small:{query:"(max-width: 767px)",totalColumns:4,gutterWidth:spacing.medium_16,marginWidth:spacing.medium_16},medium:{query:"(min-width: 768px) and (max-width: 1023px)",totalColumns:8,gutterWidth:spacing.xLarge_32,marginWidth:spacing.large_24},large:{query:"(min-width: 1024px)",totalColumns:12,gutterWidth:spacing.xLarge_32,marginWidth:mediaDefaultSpecLargeMarginWidth,maxWidth:1120+mediaDefaultSpecLargeMarginWidth*2}};const MEDIA_INTERNAL_SPEC={large:{query:"(min-width: 1px)",totalColumns:12,gutterWidth:spacing.xLarge_32,marginWidth:spacing.medium_16}};const MEDIA_MODAL_SPEC={small:{query:"(max-width: 767px)",totalColumns:4,gutterWidth:spacing.medium_16,marginWidth:spacing.medium_16},large:{query:"(min-width: 768px)",totalColumns:12,gutterWidth:spacing.xLarge_32,marginWidth:spacing.xxLarge_48}};
7
+ const VALID_MEDIA_SIZES=["small","medium","large"];const SIZE_160_PX=parseInt(remToPx(tokenValue(sizing.size_160)));const SIZE_240_PX=parseInt(remToPx(tokenValue(sizing.size_240)));const SIZE_320_PX=parseInt(remToPx(tokenValue(sizing.size_320)));const SIZE_480_PX=parseInt(remToPx(tokenValue(sizing.size_480)));const mediaDefaultSpecLargeMarginWidth=SIZE_240_PX;const MEDIA_DEFAULT_SPEC={small:{query:"(max-width: 767px)",totalColumns:4,gutterWidth:SIZE_160_PX,marginWidth:SIZE_160_PX},medium:{query:"(min-width: 768px) and (max-width: 1023px)",totalColumns:8,gutterWidth:SIZE_320_PX,marginWidth:SIZE_240_PX},large:{query:"(min-width: 1024px)",totalColumns:12,gutterWidth:SIZE_320_PX,marginWidth:mediaDefaultSpecLargeMarginWidth,maxWidth:1120+mediaDefaultSpecLargeMarginWidth*2}};const MEDIA_INTERNAL_SPEC={large:{query:"(min-width: 1px)",totalColumns:12,gutterWidth:SIZE_320_PX,marginWidth:SIZE_160_PX}};const MEDIA_MODAL_SPEC={small:{query:"(max-width: 767px)",totalColumns:4,gutterWidth:SIZE_160_PX,marginWidth:SIZE_160_PX},large:{query:"(min-width: 768px)",totalColumns:12,gutterWidth:SIZE_320_PX,marginWidth:SIZE_480_PX}};
8
8
 
9
9
  const defaultContext={ssrSize:"large",mediaSpec:MEDIA_DEFAULT_SPEC};const MediaLayoutContext=React.createContext(defaultContext);MediaLayoutContext.displayName="MediaLayoutContext";
10
10
 
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ function _interopNamespace(e) {
28
28
 
29
29
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
30
30
 
31
- const VALID_MEDIA_SIZES=["small","medium","large"];const mediaDefaultSpecLargeMarginWidth=wonderBlocksTokens.spacing.large_24;const MEDIA_DEFAULT_SPEC={small:{query:"(max-width: 767px)",totalColumns:4,gutterWidth:wonderBlocksTokens.spacing.medium_16,marginWidth:wonderBlocksTokens.spacing.medium_16},medium:{query:"(min-width: 768px) and (max-width: 1023px)",totalColumns:8,gutterWidth:wonderBlocksTokens.spacing.xLarge_32,marginWidth:wonderBlocksTokens.spacing.large_24},large:{query:"(min-width: 1024px)",totalColumns:12,gutterWidth:wonderBlocksTokens.spacing.xLarge_32,marginWidth:mediaDefaultSpecLargeMarginWidth,maxWidth:1120+mediaDefaultSpecLargeMarginWidth*2}};const MEDIA_INTERNAL_SPEC={large:{query:"(min-width: 1px)",totalColumns:12,gutterWidth:wonderBlocksTokens.spacing.xLarge_32,marginWidth:wonderBlocksTokens.spacing.medium_16}};const MEDIA_MODAL_SPEC={small:{query:"(max-width: 767px)",totalColumns:4,gutterWidth:wonderBlocksTokens.spacing.medium_16,marginWidth:wonderBlocksTokens.spacing.medium_16},large:{query:"(min-width: 768px)",totalColumns:12,gutterWidth:wonderBlocksTokens.spacing.xLarge_32,marginWidth:wonderBlocksTokens.spacing.xxLarge_48}};
31
+ const VALID_MEDIA_SIZES=["small","medium","large"];const SIZE_160_PX=parseInt(wonderBlocksTokens.remToPx(wonderBlocksTokens.tokenValue(wonderBlocksTokens.sizing.size_160)));const SIZE_240_PX=parseInt(wonderBlocksTokens.remToPx(wonderBlocksTokens.tokenValue(wonderBlocksTokens.sizing.size_240)));const SIZE_320_PX=parseInt(wonderBlocksTokens.remToPx(wonderBlocksTokens.tokenValue(wonderBlocksTokens.sizing.size_320)));const SIZE_480_PX=parseInt(wonderBlocksTokens.remToPx(wonderBlocksTokens.tokenValue(wonderBlocksTokens.sizing.size_480)));const mediaDefaultSpecLargeMarginWidth=SIZE_240_PX;const MEDIA_DEFAULT_SPEC={small:{query:"(max-width: 767px)",totalColumns:4,gutterWidth:SIZE_160_PX,marginWidth:SIZE_160_PX},medium:{query:"(min-width: 768px) and (max-width: 1023px)",totalColumns:8,gutterWidth:SIZE_320_PX,marginWidth:SIZE_240_PX},large:{query:"(min-width: 1024px)",totalColumns:12,gutterWidth:SIZE_320_PX,marginWidth:mediaDefaultSpecLargeMarginWidth,maxWidth:1120+mediaDefaultSpecLargeMarginWidth*2}};const MEDIA_INTERNAL_SPEC={large:{query:"(min-width: 1px)",totalColumns:12,gutterWidth:SIZE_320_PX,marginWidth:SIZE_160_PX}};const MEDIA_MODAL_SPEC={small:{query:"(max-width: 767px)",totalColumns:4,gutterWidth:SIZE_160_PX,marginWidth:SIZE_160_PX},large:{query:"(min-width: 768px)",totalColumns:12,gutterWidth:SIZE_320_PX,marginWidth:SIZE_480_PX}};
32
32
 
33
33
  const defaultContext={ssrSize:"large",mediaSpec:MEDIA_DEFAULT_SPEC};const MediaLayoutContext=React__namespace.createContext(defaultContext);MediaLayoutContext.displayName="MediaLayoutContext";
34
34
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "3.1.48",
6
+ "version": "3.1.50",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -21,7 +21,7 @@
21
21
  "types": "dist/index.d.ts",
22
22
  "dependencies": {
23
23
  "@khanacademy/wonder-blocks-core": "12.4.3",
24
- "@khanacademy/wonder-blocks-tokens": "16.3.0"
24
+ "@khanacademy/wonder-blocks-tokens": "16.4.1"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "aphrodite": "^1.2.5",