@oxyhq/bloom 0.87.1 → 0.89.0
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/lib/commonjs/accordion/Accordion.js +7 -5
- package/lib/commonjs/accordion/Accordion.js.map +1 -1
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js +7 -12
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/commonjs/button/Button.js +8 -7
- package/lib/commonjs/button/Button.js.map +1 -1
- package/lib/commonjs/button/Button.web.js +2 -6
- package/lib/commonjs/button/Button.web.js.map +1 -1
- package/lib/commonjs/checkbox/Checkbox.js +10 -5
- package/lib/commonjs/checkbox/Checkbox.js.map +1 -1
- package/lib/commonjs/chip/Chip.js +10 -1
- package/lib/commonjs/chip/Chip.js.map +1 -1
- package/lib/commonjs/collapsible/Collapsible.js +5 -4
- package/lib/commonjs/collapsible/Collapsible.js.map +1 -1
- package/lib/commonjs/composition-bar/CompositionBar.js +6 -1
- package/lib/commonjs/composition-bar/CompositionBar.js.map +1 -1
- package/lib/commonjs/connection-dots/ConnectionDots.web.js +2 -6
- package/lib/commonjs/connection-dots/ConnectionDots.web.js.map +1 -1
- package/lib/commonjs/design-tokens/index.js +19 -0
- package/lib/commonjs/design-tokens/index.js.map +1 -1
- package/lib/commonjs/design-tokens/tokens-json.js +149 -0
- package/lib/commonjs/design-tokens/tokens-json.js.map +1 -0
- package/lib/commonjs/design-tokens/tokens.json +6681 -0
- package/lib/commonjs/dialog/Dialog.web.js +2 -6
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/fab/Fab.web.js +2 -6
- package/lib/commonjs/fab/Fab.web.js.map +1 -1
- package/lib/commonjs/fonts/apply-font-faces.web.js +8 -10
- package/lib/commonjs/fonts/apply-font-faces.web.js.map +1 -1
- package/lib/commonjs/frosted-icon-button/FrostedIconButton.js +7 -1
- package/lib/commonjs/frosted-icon-button/FrostedIconButton.js.map +1 -1
- package/lib/commonjs/frosted-icon-button/FrostedIconButton.web.js +2 -6
- package/lib/commonjs/frosted-icon-button/FrostedIconButton.web.js.map +1 -1
- package/lib/commonjs/input-group/InputGroup.js +6 -4
- package/lib/commonjs/input-group/InputGroup.js.map +1 -1
- package/lib/commonjs/item/Item.js +23 -5
- package/lib/commonjs/item/Item.js.map +1 -1
- package/lib/commonjs/loading/SpinnerIcon.web.js +2 -6
- package/lib/commonjs/loading/SpinnerIcon.web.js.map +1 -1
- package/lib/commonjs/segmented-control/index.js +12 -5
- package/lib/commonjs/segmented-control/index.js.map +1 -1
- package/lib/commonjs/select/index.js +6 -4
- package/lib/commonjs/select/index.js.map +1 -1
- package/lib/commonjs/select/index.web.js +6 -4
- package/lib/commonjs/select/index.web.js.map +1 -1
- package/lib/commonjs/settings-list/SettingsList.js +6 -4
- package/lib/commonjs/settings-list/SettingsList.js.map +1 -1
- package/lib/commonjs/slider/Slider.js +12 -9
- package/lib/commonjs/slider/Slider.js.map +1 -1
- package/lib/commonjs/styles/adopt-style-sheet.js +126 -0
- package/lib/commonjs/styles/adopt-style-sheet.js.map +1 -0
- package/lib/commonjs/switch/Switch.js +9 -5
- package/lib/commonjs/switch/Switch.js.map +1 -1
- package/lib/commonjs/tab-bar/TabBarBase.js +6 -4
- package/lib/commonjs/tab-bar/TabBarBase.js.map +1 -1
- package/lib/module/accordion/Accordion.js +7 -5
- package/lib/module/accordion/Accordion.js.map +1 -1
- package/lib/module/bottom-sheet/BottomSheetBase.js +7 -12
- package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/module/button/Button.js +8 -7
- package/lib/module/button/Button.js.map +1 -1
- package/lib/module/button/Button.web.js +2 -6
- package/lib/module/button/Button.web.js.map +1 -1
- package/lib/module/checkbox/Checkbox.js +10 -5
- package/lib/module/checkbox/Checkbox.js.map +1 -1
- package/lib/module/chip/Chip.js +10 -1
- package/lib/module/chip/Chip.js.map +1 -1
- package/lib/module/collapsible/Collapsible.js +5 -4
- package/lib/module/collapsible/Collapsible.js.map +1 -1
- package/lib/module/composition-bar/CompositionBar.js +6 -1
- package/lib/module/composition-bar/CompositionBar.js.map +1 -1
- package/lib/module/connection-dots/ConnectionDots.web.js +2 -6
- package/lib/module/connection-dots/ConnectionDots.web.js.map +1 -1
- package/lib/module/design-tokens/index.js +5 -0
- package/lib/module/design-tokens/index.js.map +1 -1
- package/lib/module/design-tokens/tokens-json.js +144 -0
- package/lib/module/design-tokens/tokens-json.js.map +1 -0
- package/lib/module/design-tokens/tokens.json +6681 -0
- package/lib/module/dialog/Dialog.web.js +2 -6
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/fab/Fab.web.js +2 -6
- package/lib/module/fab/Fab.web.js.map +1 -1
- package/lib/module/fonts/apply-font-faces.web.js +8 -10
- package/lib/module/fonts/apply-font-faces.web.js.map +1 -1
- package/lib/module/frosted-icon-button/FrostedIconButton.js +7 -1
- package/lib/module/frosted-icon-button/FrostedIconButton.js.map +1 -1
- package/lib/module/frosted-icon-button/FrostedIconButton.web.js +2 -6
- package/lib/module/frosted-icon-button/FrostedIconButton.web.js.map +1 -1
- package/lib/module/input-group/InputGroup.js +6 -4
- package/lib/module/input-group/InputGroup.js.map +1 -1
- package/lib/module/item/Item.js +23 -5
- package/lib/module/item/Item.js.map +1 -1
- package/lib/module/loading/SpinnerIcon.web.js +2 -6
- package/lib/module/loading/SpinnerIcon.web.js.map +1 -1
- package/lib/module/segmented-control/index.js +12 -5
- package/lib/module/segmented-control/index.js.map +1 -1
- package/lib/module/select/index.js +6 -4
- package/lib/module/select/index.js.map +1 -1
- package/lib/module/select/index.web.js +6 -4
- package/lib/module/select/index.web.js.map +1 -1
- package/lib/module/settings-list/SettingsList.js +6 -4
- package/lib/module/settings-list/SettingsList.js.map +1 -1
- package/lib/module/slider/Slider.js +12 -9
- package/lib/module/slider/Slider.js.map +1 -1
- package/lib/module/styles/adopt-style-sheet.js +121 -0
- package/lib/module/styles/adopt-style-sheet.js.map +1 -0
- package/lib/module/switch/Switch.js +9 -5
- package/lib/module/switch/Switch.js.map +1 -1
- package/lib/module/tab-bar/TabBarBase.js +6 -4
- package/lib/module/tab-bar/TabBarBase.js.map +1 -1
- package/lib/typescript/commonjs/accordion/Accordion.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/button/Button.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/commonjs/chip/Chip.d.ts.map +1 -1
- package/lib/typescript/commonjs/collapsible/Collapsible.d.ts.map +1 -1
- package/lib/typescript/commonjs/composition-bar/CompositionBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/connection-dots/ConnectionDots.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/design-tokens/index.d.ts +2 -0
- package/lib/typescript/commonjs/design-tokens/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/design-tokens/tokens-json.d.ts +85 -0
- package/lib/typescript/commonjs/design-tokens/tokens-json.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/fab/Fab.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/fonts/apply-font-faces.web.d.ts +5 -3
- package/lib/typescript/commonjs/fonts/apply-font-faces.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/frosted-icon-button/FrostedIconButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/frosted-icon-button/FrostedIconButton.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/input-group/InputGroup.d.ts.map +1 -1
- package/lib/typescript/commonjs/item/Item.d.ts.map +1 -1
- package/lib/typescript/commonjs/loading/SpinnerIcon.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/segmented-control/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/settings-list/SettingsList.d.ts.map +1 -1
- package/lib/typescript/commonjs/slider/Slider.d.ts.map +1 -1
- package/lib/typescript/commonjs/styles/adopt-style-sheet.d.ts +22 -0
- package/lib/typescript/commonjs/styles/adopt-style-sheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/switch/Switch.d.ts.map +1 -1
- package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts.map +1 -1
- package/lib/typescript/module/accordion/Accordion.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/module/button/Button.d.ts.map +1 -1
- package/lib/typescript/module/button/Button.web.d.ts.map +1 -1
- package/lib/typescript/module/checkbox/Checkbox.d.ts.map +1 -1
- package/lib/typescript/module/chip/Chip.d.ts.map +1 -1
- package/lib/typescript/module/collapsible/Collapsible.d.ts.map +1 -1
- package/lib/typescript/module/composition-bar/CompositionBar.d.ts.map +1 -1
- package/lib/typescript/module/connection-dots/ConnectionDots.web.d.ts.map +1 -1
- package/lib/typescript/module/design-tokens/index.d.ts +2 -0
- package/lib/typescript/module/design-tokens/index.d.ts.map +1 -1
- package/lib/typescript/module/design-tokens/tokens-json.d.ts +85 -0
- package/lib/typescript/module/design-tokens/tokens-json.d.ts.map +1 -0
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/fab/Fab.web.d.ts.map +1 -1
- package/lib/typescript/module/fonts/apply-font-faces.web.d.ts +5 -3
- package/lib/typescript/module/fonts/apply-font-faces.web.d.ts.map +1 -1
- package/lib/typescript/module/frosted-icon-button/FrostedIconButton.d.ts.map +1 -1
- package/lib/typescript/module/frosted-icon-button/FrostedIconButton.web.d.ts.map +1 -1
- package/lib/typescript/module/input-group/InputGroup.d.ts.map +1 -1
- package/lib/typescript/module/item/Item.d.ts.map +1 -1
- package/lib/typescript/module/loading/SpinnerIcon.web.d.ts.map +1 -1
- package/lib/typescript/module/segmented-control/index.d.ts.map +1 -1
- package/lib/typescript/module/select/index.d.ts.map +1 -1
- package/lib/typescript/module/select/index.web.d.ts.map +1 -1
- package/lib/typescript/module/settings-list/SettingsList.d.ts.map +1 -1
- package/lib/typescript/module/slider/Slider.d.ts.map +1 -1
- package/lib/typescript/module/styles/adopt-style-sheet.d.ts +22 -0
- package/lib/typescript/module/styles/adopt-style-sheet.d.ts.map +1 -0
- package/lib/typescript/module/switch/Switch.d.ts.map +1 -1
- package/lib/typescript/module/tab-bar/TabBarBase.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/__tests__/Button.test.tsx +11 -3
- package/src/__tests__/InputGroup.test.tsx +4 -1
- package/src/__tests__/Item.test.tsx +5 -1
- package/src/__tests__/Slider.test.tsx +11 -2
- package/src/__tests__/TabBar.test.tsx +9 -1
- package/src/__tests__/TabBarNoSelection.test.tsx +3 -1
- package/src/__tests__/adopt-style-sheet.node.test.ts +21 -0
- package/src/__tests__/adopt-style-sheet.test.ts +165 -0
- package/src/__tests__/apply-font-faces.test.ts +32 -0
- package/src/__tests__/aria-state-web.test.tsx +466 -0
- package/src/__tests__/design-tokens-json.test.ts +112 -0
- package/src/__tests__/exports-map-contract.test.ts +5 -1
- package/src/__tests__/support/constructed-style-sheets.ts +68 -0
- package/src/accordion/Accordion.tsx +5 -1
- package/src/bottom-sheet/BottomSheetBase.tsx +10 -14
- package/src/button/Button.tsx +6 -1
- package/src/button/Button.web.tsx +2 -6
- package/src/checkbox/Checkbox.tsx +8 -1
- package/src/chip/Chip.tsx +8 -0
- package/src/collapsible/Collapsible.tsx +3 -1
- package/src/composition-bar/CompositionBar.tsx +4 -0
- package/src/connection-dots/ConnectionDots.web.tsx +2 -6
- package/src/design-tokens/index.ts +16 -0
- package/src/design-tokens/tokens-json.ts +214 -0
- package/src/design-tokens/tokens.json +6681 -0
- package/src/dialog/Dialog.web.tsx +2 -6
- package/src/fab/Fab.web.tsx +2 -6
- package/src/fonts/apply-font-faces.web.ts +11 -11
- package/src/frosted-icon-button/FrostedIconButton.tsx +5 -0
- package/src/frosted-icon-button/FrostedIconButton.web.tsx +2 -6
- package/src/input-group/InputGroup.tsx +4 -1
- package/src/item/Item.tsx +24 -2
- package/src/loading/SpinnerIcon.web.tsx +2 -6
- package/src/segmented-control/index.tsx +8 -1
- package/src/select/index.tsx +4 -1
- package/src/select/index.web.tsx +4 -1
- package/src/settings-list/SettingsList.tsx +4 -1
- package/src/slider/Slider.tsx +10 -2
- package/src/styles/adopt-style-sheet.ts +131 -0
- package/src/switch/Switch.tsx +7 -1
- package/src/tab-bar/TabBarBase.tsx +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Fab.web.d.ts","sourceRoot":"","sources":["../../../../src/fab/Fab.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Fab.web.d.ts","sourceRoot":"","sources":["../../../../src/fab/Fab.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAMf,OAAO,KAAK,EAAgB,QAAQ,EAAuB,MAAM,SAAS,CAAC;AAE3E,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AA+R3E,eAAO,MAAM,GAAG,sCAAwB,CAAC"}
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
* Web-only. The native counterpart in `apply-font-faces.ts` is a no-op
|
|
5
5
|
* stub — native loads its fonts through `useFonts(FONT_ASSETS)`, so the file
|
|
6
6
|
* split keeps the web font payload out of the native bundle entirely.
|
|
7
|
-
* Idempotent: safe to call multiple times;
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Idempotent: safe to call multiple times; `adoptStyleSheet` keys the sheet by
|
|
8
|
+
* id, so repeat calls re-parse nothing. SSR-safe via its `typeof document`
|
|
9
|
+
* guard. `BloomThemeProvider` calls this on every mount by default, which is
|
|
10
|
+
* why it also has to survive a page whose CSP forbids inline styles — see
|
|
11
|
+
* `styles/adopt-style-sheet.ts`.
|
|
10
12
|
*
|
|
11
13
|
* The URLs come from `./font-urls.web`, which imports the `.woff2` files so
|
|
12
14
|
* the consuming bundler emits them as separate, cacheable assets. See that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-font-faces.web.d.ts","sourceRoot":"","sources":["../../../../src/fonts/apply-font-faces.web.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply-font-faces.web.d.ts","sourceRoot":"","sources":["../../../../src/fonts/apply-font-faces.web.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAerC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrostedIconButton.d.ts","sourceRoot":"","sources":["../../../../src/frosted-icon-button/FrostedIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAkB7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"FrostedIconButton.d.ts","sourceRoot":"","sources":["../../../../src/frosted-icon-button/FrostedIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAkB7C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA2I7E,eAAO,MAAM,iBAAiB,oDAAmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrostedIconButton.web.d.ts","sourceRoot":"","sources":["../../../../src/frosted-icon-button/FrostedIconButton.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FrostedIconButton.web.d.ts","sourceRoot":"","sources":["../../../../src/frosted-icon-button/FrostedIconButton.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAUf,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAqL7E,eAAO,MAAM,iBAAiB,oDAAsC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../../../../src/input-group/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAyDrE,eAAO,MAAM,KAAK,+EApCf,oBAAoB,6CAoCkB,CAAC;
|
|
1
|
+
{"version":3,"file":"InputGroup.d.ts","sourceRoot":"","sources":["../../../../src/input-group/InputGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAKN,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAyDrE,eAAO,MAAM,KAAK,+EApCf,oBAAoB,6CAoCkB,CAAC;AAqH1C,eAAO,MAAM,UAAU;6EA3FpB,eAAe;;wFA9Df,oBAAoB;CAyJ2C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/item/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAO7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../../src/item/Item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAO7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAiMzC,eAAO,MAAM,IAAI,kQA3Jd,SAAS,6CA2J2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpinnerIcon.web.d.ts","sourceRoot":"","sources":["../../../../src/loading/SpinnerIcon.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"SpinnerIcon.web.d.ts","sourceRoot":"","sources":["../../../../src/loading/SpinnerIcon.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAKhE,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AA4CD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,8GAE7B,CAAC;AAiBF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAuClD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/segmented-control/index.tsx"],"names":[],"mappings":"AASA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,IAAI,EACJ,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAmBtB;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,EACjD,KAAK,EACL,IAAc,EACd,IAAc,EACd,KAAK,EACL,QAAQ,EACR,QAA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@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAcf,OAAO,EAA0C,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACxF,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,WAAW,EAEX,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,oBAAoB,EAAE,CAAC;AA8BhC,wBAAgB,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,WAAW,2CAgB/E;AAMD,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,kBAAkB,yTAqCpE;AAMD,wBAAgB,WAAW,CAAC,EAC1B,WAAW,EACX,QAAQ,EAAE,YAAkC,EAC5C,KAAK,GACN,EAAE,gBAAgB,2CAkBlB;AAaD,wBAAgB,UAAU,CAAC,MAAM,EAAE,eAAe,2CAGjD;AAMD,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAC/B,KAAK,EACL,cAA0C,EAC1C,GAAG,KAAK,EACT,EAAE,kBAAkB,CAAC,CAAC,CAAC,2CAwBvB;AA8DD,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAcf,OAAO,EAA0C,oBAAoB,EAAE,MAAM,UAAU,CAAC;AACxF,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,WAAW,EAEX,kBAAkB,EAClB,gBAAgB,EACjB,MAAM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MD,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,EAAE,eAAe,2CAGpD;AAMD,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAC/B,KAAK,EACL,UAAU,EACV,KAA0B,EAC1B,cAA0C,GAC3C,EAAE,kBAAkB,CAAC,CAAC,CAAC,kDAgGvB;AAMD,wBAAgB,UAAU,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,eAAe,2CAgDjF;AAMD,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CAMtE;AAMD,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,aAAyB,EAAE,EAAE,wBAAwB,2CAYhG;AAMD,wBAAgB,eAAe,4CAW9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsList.d.ts","sourceRoot":"","sources":["../../../../src/settings-list/SettingsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAKpC,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAoBjB,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"SettingsList.d.ts","sourceRoot":"","sources":["../../../../src/settings-list/SettingsList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAKpC,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAoBjB,eAAO,MAAM,gBAAgB,mDA6G3B,CAAC;AAIH,eAAO,MAAM,iBAAiB,oDA6C5B,CAAC;AAIH,eAAO,MAAM,mBAAmB,sDAY/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../../src/slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAe5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Slider.d.ts","sourceRoot":"","sources":["../../../../src/slider/Slider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuD,MAAM,OAAO,CAAC;AAe5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAwQ3C,eAAO,MAAM,MAAM,8NAhOhB,WAAW,6CAgO6B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Make `css` apply to the document, under the identity `id`.
|
|
3
|
+
*
|
|
4
|
+
* Idempotent in both directions: calling it again with the same CSS re-parses
|
|
5
|
+
* nothing and adopts nothing twice (the usual case — every mount of every
|
|
6
|
+
* instance of a component calls it), and calling it with DIFFERENT CSS under
|
|
7
|
+
* the same id replaces the previous content in place (the theme-dependent case,
|
|
8
|
+
* `BottomSheetBase`'s scrollbar colours).
|
|
9
|
+
*
|
|
10
|
+
* No-op off the web, so a platform-neutral component can call it unguarded.
|
|
11
|
+
*/
|
|
12
|
+
export declare function adoptStyleSheet(id: string, css: string): void;
|
|
13
|
+
/**
|
|
14
|
+
* Detach the stylesheet `id`, whichever path installed it.
|
|
15
|
+
*
|
|
16
|
+
* Only for CSS whose lifetime is a component's — `BottomSheetBase` removes its
|
|
17
|
+
* scrollbar rules when the last sheet unmounts. The static per-component CSS is
|
|
18
|
+
* never dropped: it is the same bytes for the life of the page, and removing it
|
|
19
|
+
* on unmount would make a re-mount re-parse it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function dropStyleSheet(id: string): void;
|
|
22
|
+
//# sourceMappingURL=adopt-style-sheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adopt-style-sheet.d.ts","sourceRoot":"","sources":["../../../../src/styles/adopt-style-sheet.ts"],"names":[],"mappings":"AAmEA;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CA+B7D;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAW/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAMzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../../../src/switch/Switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAMzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAyH3C,eAAO,MAAM,MAAM,4FAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabBarBase.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/TabBarBase.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAkBL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAe,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"TabBarBase.d.ts","sourceRoot":"","sources":["../../../../src/tab-bar/TabBarBase.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAOL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAkBL,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAe,MAAM,SAAS,CAAC;AA+iB3E;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,aAAa,CAAC,kBAAkB,CAAC,EAC1C,IAAI,EAAE,aAAa,CAAC,oBAAoB,CAAC;YAElB,WAAW;;EAGnC;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,CAAC,gBAAgB,CAAC;YAC1C,iBAAiB;;EAG/C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/bloom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.89.0",
|
|
4
4
|
"packageManager": "bun@1.3.14",
|
|
5
5
|
"description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
|
|
6
6
|
"main": "lib/commonjs/index.js",
|
|
@@ -1386,6 +1386,7 @@
|
|
|
1386
1386
|
}
|
|
1387
1387
|
},
|
|
1388
1388
|
"./design-tokens/theme.css": "./src/design-tokens/theme.css",
|
|
1389
|
+
"./design-tokens/tokens.json": "./src/design-tokens/tokens.json",
|
|
1389
1390
|
"./package.json": "./package.json"
|
|
1390
1391
|
},
|
|
1391
1392
|
"files": [
|
|
@@ -1454,7 +1455,8 @@
|
|
|
1454
1455
|
"scripts": {
|
|
1455
1456
|
"generate:exports": "node scripts/generate-platform-exports.mjs",
|
|
1456
1457
|
"generate:theme-css": "bun scripts/generate-theme-css.ts",
|
|
1457
|
-
"
|
|
1458
|
+
"generate:tokens-json": "bun scripts/generate-design-tokens-json.ts",
|
|
1459
|
+
"prebuild": "node scripts/generate-platform-exports.mjs && bun scripts/generate-theme-css.ts && bun scripts/generate-design-tokens-json.ts",
|
|
1458
1460
|
"build": "bob build",
|
|
1459
1461
|
"postbuild": "node scripts/verify-package.mjs",
|
|
1460
1462
|
"verify:package": "node scripts/verify-package.mjs",
|
|
@@ -124,7 +124,11 @@ describe('Button', () => {
|
|
|
124
124
|
</Button>,
|
|
125
125
|
);
|
|
126
126
|
const btn = getByTestId('dis-btn');
|
|
127
|
-
|
|
127
|
+
// The `disabled` PROP is what carries this to both platforms: React Native
|
|
128
|
+
// folds it into `accessibilityState`, and react-native-web's `Pressable`
|
|
129
|
+
// derives `aria-disabled` from it (overwriting any the caller passes, so
|
|
130
|
+
// the prop is the only spelling that works there).
|
|
131
|
+
expect(btn.props.disabled).toBe(true);
|
|
128
132
|
});
|
|
129
133
|
|
|
130
134
|
it('keeps children mounted when loading so width is preserved', () => {
|
|
@@ -151,14 +155,18 @@ describe('Button', () => {
|
|
|
151
155
|
expect(btn.props.disabled).toBe(true);
|
|
152
156
|
});
|
|
153
157
|
|
|
154
|
-
it('marks loading state
|
|
158
|
+
it('marks loading state as busy + disabled', () => {
|
|
155
159
|
const { getByTestId } = renderWithTheme(
|
|
156
160
|
<Button testID="busy-btn" loading>
|
|
157
161
|
Submit
|
|
158
162
|
</Button>,
|
|
159
163
|
);
|
|
160
164
|
const btn = getByTestId('busy-btn');
|
|
161
|
-
|
|
165
|
+
// `aria-busy` rather than `accessibilityState.busy`, which react-native-web
|
|
166
|
+
// drops — this is also what `Button.web.tsx` emits, so both forks announce
|
|
167
|
+
// the same thing. React Native folds it back into `accessibilityState`.
|
|
168
|
+
expect(btn.props['aria-busy']).toBe(true);
|
|
169
|
+
expect(btn.props.disabled).toBe(true);
|
|
162
170
|
});
|
|
163
171
|
});
|
|
164
172
|
|
|
@@ -39,6 +39,9 @@ describe('InputGroup', () => {
|
|
|
39
39
|
<Text>field</Text>
|
|
40
40
|
</InputGroup>,
|
|
41
41
|
);
|
|
42
|
-
|
|
42
|
+
// `aria-disabled`, not `accessibilityState`: the group is a `View`, so
|
|
43
|
+
// react-native-web has no `disabled` prop to derive the attribute from and
|
|
44
|
+
// never reads `accessibilityState`. React Native folds this back into it.
|
|
45
|
+
expect(getByTestId('group').props['aria-disabled']).toBe(true);
|
|
43
46
|
});
|
|
44
47
|
});
|
|
@@ -47,7 +47,11 @@ describe('Item', () => {
|
|
|
47
47
|
<Item title="Disabled" onPress={onPress} disabled accessibilityLabel="Disabled" />,
|
|
48
48
|
);
|
|
49
49
|
const node = getByLabelText('Disabled');
|
|
50
|
-
|
|
50
|
+
// `selected` is absent, not `false`: a row that never mentions selection is
|
|
51
|
+
// not a toggle. Defaulting it made every plain navigation row announce
|
|
52
|
+
// itself as an unpressed toggle button once the state reached web as
|
|
53
|
+
// `aria-pressed`. A caller passing `selected={false}` still gets `false`.
|
|
54
|
+
expect(node.props.accessibilityState).toEqual({ disabled: true, selected: undefined });
|
|
51
55
|
// The Pressable receives no press handler while disabled.
|
|
52
56
|
expect(node.props.onPress).toBeUndefined();
|
|
53
57
|
});
|
|
@@ -19,14 +19,23 @@ describe('Slider', () => {
|
|
|
19
19
|
);
|
|
20
20
|
const node = getByTestId('slider');
|
|
21
21
|
expect(node.props.accessibilityRole).toBe('adjustable');
|
|
22
|
-
|
|
22
|
+
// The FLAT `aria-value*` props, not the `accessibilityValue` object:
|
|
23
|
+
// react-native-web has no handling for the object form at all, so the
|
|
24
|
+
// object shape rendered a `role="slider"` carrying no value on web.
|
|
25
|
+
// React Native folds these three back into `accessibilityValue`.
|
|
26
|
+
expect(node.props['aria-valuemin']).toBe(0);
|
|
27
|
+
expect(node.props['aria-valuemax']).toBe(100);
|
|
28
|
+
expect(node.props['aria-valuenow']).toBe(40);
|
|
23
29
|
});
|
|
24
30
|
|
|
25
31
|
it('reflects the disabled state', () => {
|
|
26
32
|
const { getByTestId } = renderWithTheme(
|
|
27
33
|
<Slider value={0} onValueChange={() => {}} disabled testID="slider" />,
|
|
28
34
|
);
|
|
29
|
-
|
|
35
|
+
// A `View` has no `disabled` prop for react-native-web to read, and it
|
|
36
|
+
// ignores `accessibilityState`, so `aria-disabled` is the only spelling
|
|
37
|
+
// that reaches the DOM.
|
|
38
|
+
expect(getByTestId('slider').props['aria-disabled']).toBe(true);
|
|
30
39
|
});
|
|
31
40
|
|
|
32
41
|
it('renders without crashing for fractional steps', () => {
|
|
@@ -156,8 +156,16 @@ function hosts(root: ReactTestInstance, tag: string): ReactTestInstance[] {
|
|
|
156
156
|
return root.findAll((node) => hostName(node) === tag);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
+
/**
|
|
160
|
+
* Read `aria-selected`, not `accessibilityState.selected`. The latter reaches
|
|
161
|
+
* native only: react-native-web's `createDOMProps` never consults
|
|
162
|
+
* `accessibilityState`, so a bar that set only that rendered tabs announcing no
|
|
163
|
+
* selection at all on web. React Native folds `aria-selected` back into
|
|
164
|
+
* `accessibilityState`, making this the one spelling both platforms honour —
|
|
165
|
+
* the same contract `Tabs.test.tsx` pins for the tab strip.
|
|
166
|
+
*/
|
|
159
167
|
function selectedFlags(root: ReactTestInstance): boolean[] {
|
|
160
|
-
return triggers(root).map((node) => node.props
|
|
168
|
+
return triggers(root).map((node) => node.props['aria-selected']);
|
|
161
169
|
}
|
|
162
170
|
|
|
163
171
|
function Bar({
|
|
@@ -221,7 +221,9 @@ function labelColors(root: ReactTestInstance): unknown[] {
|
|
|
221
221
|
function selectedFlags(root: ReactTestInstance): boolean[] {
|
|
222
222
|
return root
|
|
223
223
|
.findAll((node) => hostName(node) !== null && node.props?.accessibilityRole === 'tab')
|
|
224
|
-
|
|
224
|
+
// `aria-selected` is the spelling both platforms read — see the same
|
|
225
|
+
// helper in `TabBar.test.tsx`.
|
|
226
|
+
.map((node) => node.props['aria-selected']);
|
|
225
227
|
}
|
|
226
228
|
|
|
227
229
|
/** The gesture the detector was actually given — the last race constructed. */
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment node
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { adoptStyleSheet, dropStyleSheet } from '../styles/adopt-style-sheet';
|
|
6
|
+
|
|
7
|
+
/* Centralising the injection also centralised the `typeof document` guard that
|
|
8
|
+
* used to sit in each fork. It has to stay: `adoptStyleSheet` is reached from a
|
|
9
|
+
* platform-neutral component (`BottomSheetBase`) and from every server render,
|
|
10
|
+
* where throwing would take the whole page down rather than lose a stylesheet.
|
|
11
|
+
* Needs its own file — jest picks the environment per file. */
|
|
12
|
+
describe('adoptStyleSheet with no document (native / SSR)', () => {
|
|
13
|
+
it('the environment under test genuinely has no document', () => {
|
|
14
|
+
expect(typeof document).toBe('undefined');
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it('is a no-op rather than a throw', () => {
|
|
18
|
+
expect(() => adoptStyleSheet('bloom-test', '.x {}')).not.toThrow();
|
|
19
|
+
expect(() => dropStyleSheet('bloom-test')).not.toThrow();
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
installConstructedStyleSheets,
|
|
7
|
+
type ConstructedStyleSheetsHarness,
|
|
8
|
+
} from './support/constructed-style-sheets';
|
|
9
|
+
|
|
10
|
+
type AdoptStyleSheetModule = typeof import('../styles/adopt-style-sheet');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A fresh copy of the module per test. It keeps the sheets it has constructed in
|
|
14
|
+
* a module-scope registry, so without this a later test would see the previous
|
|
15
|
+
* one's sheet and the idempotence cases would prove nothing.
|
|
16
|
+
*/
|
|
17
|
+
function freshModule(): AdoptStyleSheetModule {
|
|
18
|
+
let loaded: AdoptStyleSheetModule | undefined;
|
|
19
|
+
jest.isolateModules(() => {
|
|
20
|
+
loaded = require('../styles/adopt-style-sheet') as AdoptStyleSheetModule;
|
|
21
|
+
});
|
|
22
|
+
if (!loaded) throw new Error('adopt-style-sheet failed to load');
|
|
23
|
+
return loaded;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
describe('adoptStyleSheet — constructed stylesheets (the CSP-safe path)', () => {
|
|
27
|
+
let harness: ConstructedStyleSheetsHarness;
|
|
28
|
+
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
document.head.innerHTML = '';
|
|
31
|
+
harness = installConstructedStyleSheets();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
afterEach(() => {
|
|
35
|
+
harness.uninstall();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/* THE point of the whole change. A `<style>` element carrying text content is
|
|
39
|
+
* what `style-src 'self'` blocks, silently — so "no style element" is the
|
|
40
|
+
* assertion that fails if the adoption branch is ever removed, and it is the
|
|
41
|
+
* only one a CSP can tell apart. */
|
|
42
|
+
it('applies the CSS through an adopted sheet, creating no <style> element', () => {
|
|
43
|
+
const { adoptStyleSheet } = freshModule();
|
|
44
|
+
|
|
45
|
+
adoptStyleSheet('bloom-test', '.x { color: red; }');
|
|
46
|
+
|
|
47
|
+
expect(document.querySelectorAll('style')).toHaveLength(0);
|
|
48
|
+
expect(harness.adopted()).toHaveLength(1);
|
|
49
|
+
expect(harness.adopted()[0]?.cssText).toBe('.x { color: red; }');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('repeat calls with the same CSS re-parse nothing and adopt nothing twice', () => {
|
|
53
|
+
const { adoptStyleSheet } = freshModule();
|
|
54
|
+
|
|
55
|
+
adoptStyleSheet('bloom-test', '.x { color: red; }');
|
|
56
|
+
adoptStyleSheet('bloom-test', '.x { color: red; }');
|
|
57
|
+
adoptStyleSheet('bloom-test', '.x { color: red; }');
|
|
58
|
+
|
|
59
|
+
expect(harness.adopted()).toHaveLength(1);
|
|
60
|
+
expect(harness.adopted()[0]?.replaceSyncCalls).toBe(1);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('new CSS under the same id replaces the sheet content in place', () => {
|
|
64
|
+
const { adoptStyleSheet } = freshModule();
|
|
65
|
+
|
|
66
|
+
adoptStyleSheet('bloom-test', '.x { color: red; }');
|
|
67
|
+
const first = harness.adopted()[0];
|
|
68
|
+
adoptStyleSheet('bloom-test', '.x { color: blue; }');
|
|
69
|
+
|
|
70
|
+
expect(harness.adopted()).toHaveLength(1);
|
|
71
|
+
expect(harness.adopted()[0]).toBe(first);
|
|
72
|
+
expect(harness.adopted()[0]?.cssText).toBe('.x { color: blue; }');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('keeps one sheet per id', () => {
|
|
76
|
+
const { adoptStyleSheet } = freshModule();
|
|
77
|
+
|
|
78
|
+
adoptStyleSheet('bloom-a', '.a {}');
|
|
79
|
+
adoptStyleSheet('bloom-b', '.b {}');
|
|
80
|
+
|
|
81
|
+
expect(harness.adopted()).toHaveLength(2);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/* A consumer that owns `document.adoptedStyleSheets` can reassign it — a
|
|
85
|
+
* framework swapping its own sheets, a test resetting the document. Bloom's
|
|
86
|
+
* CSS has to come back, and without re-parsing. */
|
|
87
|
+
it('re-adopts the same sheet after the document list is reset', () => {
|
|
88
|
+
const { adoptStyleSheet } = freshModule();
|
|
89
|
+
|
|
90
|
+
adoptStyleSheet('bloom-test', '.x {}');
|
|
91
|
+
const first = harness.adopted()[0];
|
|
92
|
+
document.adoptedStyleSheets = [];
|
|
93
|
+
adoptStyleSheet('bloom-test', '.x {}');
|
|
94
|
+
|
|
95
|
+
expect(harness.adopted()).toHaveLength(1);
|
|
96
|
+
expect(harness.adopted()[0]).toBe(first);
|
|
97
|
+
expect(harness.adopted()[0]?.replaceSyncCalls).toBe(1);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('dropStyleSheet un-adopts only its own sheet', () => {
|
|
101
|
+
const { adoptStyleSheet, dropStyleSheet } = freshModule();
|
|
102
|
+
|
|
103
|
+
adoptStyleSheet('bloom-a', '.a {}');
|
|
104
|
+
adoptStyleSheet('bloom-b', '.b {}');
|
|
105
|
+
dropStyleSheet('bloom-a');
|
|
106
|
+
|
|
107
|
+
expect(harness.adopted()).toHaveLength(1);
|
|
108
|
+
expect(harness.adopted()[0]?.cssText).toBe('.b {}');
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('a dropped id can be adopted again', () => {
|
|
112
|
+
const { adoptStyleSheet, dropStyleSheet } = freshModule();
|
|
113
|
+
|
|
114
|
+
adoptStyleSheet('bloom-test', '.x {}');
|
|
115
|
+
dropStyleSheet('bloom-test');
|
|
116
|
+
adoptStyleSheet('bloom-test', '.y {}');
|
|
117
|
+
|
|
118
|
+
expect(harness.adopted()).toHaveLength(1);
|
|
119
|
+
expect(harness.adopted()[0]?.cssText).toBe('.y {}');
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
describe('adoptStyleSheet — <style> fallback', () => {
|
|
124
|
+
beforeEach(() => {
|
|
125
|
+
document.head.innerHTML = '';
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
/* Plain jsdom: no `adoptedStyleSheets`, no `replaceSync`. Same for a browser
|
|
129
|
+
* older than Chrome 73 / Safari 16.4 / Firefox 101. The CSS still has to
|
|
130
|
+
* apply — under a permissive CSP, which is what those pages have. */
|
|
131
|
+
it('the environment under test genuinely lacks the constructed API', () => {
|
|
132
|
+
expect('adoptedStyleSheets' in document).toBe(false);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('creates one <style> element carrying the CSS', () => {
|
|
136
|
+
const { adoptStyleSheet } = freshModule();
|
|
137
|
+
|
|
138
|
+
adoptStyleSheet('bloom-test', '.x { color: red; }');
|
|
139
|
+
|
|
140
|
+
const element = document.getElementById('bloom-test');
|
|
141
|
+
expect(element?.tagName).toBe('STYLE');
|
|
142
|
+
expect(element?.textContent).toBe('.x { color: red; }');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('does not duplicate the element across calls, and updates its content', () => {
|
|
146
|
+
const { adoptStyleSheet } = freshModule();
|
|
147
|
+
|
|
148
|
+
adoptStyleSheet('bloom-test', '.x { color: red; }');
|
|
149
|
+
adoptStyleSheet('bloom-test', '.x { color: blue; }');
|
|
150
|
+
|
|
151
|
+
expect(document.querySelectorAll('style#bloom-test')).toHaveLength(1);
|
|
152
|
+
expect(document.getElementById('bloom-test')?.textContent).toBe(
|
|
153
|
+
'.x { color: blue; }',
|
|
154
|
+
);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it('dropStyleSheet removes the element', () => {
|
|
158
|
+
const { adoptStyleSheet, dropStyleSheet } = freshModule();
|
|
159
|
+
|
|
160
|
+
adoptStyleSheet('bloom-test', '.x {}');
|
|
161
|
+
dropStyleSheet('bloom-test');
|
|
162
|
+
|
|
163
|
+
expect(document.getElementById('bloom-test')).toBeNull();
|
|
164
|
+
});
|
|
165
|
+
});
|
|
@@ -9,7 +9,12 @@
|
|
|
9
9
|
// resolution; here we reach for it explicitly so the test exercises the
|
|
10
10
|
// actual implementation under jsdom.
|
|
11
11
|
import { applyFontFaces } from '../fonts/apply-font-faces.web';
|
|
12
|
+
import { installConstructedStyleSheets } from './support/constructed-style-sheets';
|
|
12
13
|
|
|
14
|
+
/* jsdom has no constructed-stylesheet API, so everything in this block
|
|
15
|
+
* exercises `adoptStyleSheet`'s `<style>` fallback. The CSP-safe path a real
|
|
16
|
+
* browser takes is asserted in the last block, and in
|
|
17
|
+
* `adopt-style-sheet.test.ts`. */
|
|
13
18
|
describe('applyFontFaces (web)', () => {
|
|
14
19
|
beforeEach(() => {
|
|
15
20
|
document.head.innerHTML = '';
|
|
@@ -71,6 +76,33 @@ describe('applyFontFaces (web)', () => {
|
|
|
71
76
|
});
|
|
72
77
|
});
|
|
73
78
|
|
|
79
|
+
/* The font faces are the one injection `BloomThemeProvider` performs by
|
|
80
|
+
* default, so they are the first thing a page under `style-src 'self'` loses —
|
|
81
|
+
* and it loses them silently, as text rendered in the fallback family with no
|
|
82
|
+
* console output. Everything else Bloom injects is per-component; this is
|
|
83
|
+
* every consumer, every page. */
|
|
84
|
+
describe('applyFontFaces under a page that forbids inline styles', () => {
|
|
85
|
+
it('adopts a constructed sheet and creates no <style> element', () => {
|
|
86
|
+
document.head.innerHTML = '';
|
|
87
|
+
const harness = installConstructedStyleSheets();
|
|
88
|
+
try {
|
|
89
|
+
let fonts: typeof import('../fonts/apply-font-faces.web') | undefined;
|
|
90
|
+
jest.isolateModules(() => {
|
|
91
|
+
fonts = require('../fonts/apply-font-faces.web') as typeof fonts;
|
|
92
|
+
});
|
|
93
|
+
fonts?.applyFontFaces();
|
|
94
|
+
|
|
95
|
+
expect(document.querySelectorAll('style')).toHaveLength(0);
|
|
96
|
+
expect(harness.adopted()).toHaveLength(1);
|
|
97
|
+
const css = harness.adopted()[0]?.cssText ?? '';
|
|
98
|
+
expect(css.match(/@font-face\s*{/g) ?? []).toHaveLength(4);
|
|
99
|
+
expect(css).toMatch(/--bloom-font-sans:/);
|
|
100
|
+
} finally {
|
|
101
|
+
harness.uninstall();
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
74
106
|
describe('applyFontFaces (native stub)', () => {
|
|
75
107
|
beforeEach(() => {
|
|
76
108
|
document.head.innerHTML = '';
|