@shoelace-style/localize 2.2.0 → 2.2.1

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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.1
4
+
5
+ - Fixed a bug that prevented updates from happening when `<html dir>` changed
6
+
3
7
  ## 2.2.0
4
8
 
5
9
  - Added `dir()` method to return the target element's directionality
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ let documentLanguage = document.documentElement.lang || navigator.language;
6
6
  let fallback;
7
7
  documentElementObserver.observe(document.documentElement, {
8
8
  attributes: true,
9
- attributeFilter: ['lang']
9
+ attributeFilter: ['dir', 'lang']
10
10
  });
11
11
  export function registerTranslation(...translation) {
12
12
  translation.map(t => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoelace-style/localize",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "A micro library for localizing custom elements using Lit's Reactive Controller model.",
5
5
  "main": "/dist/index.js",
6
6
  "module": "/dist/index.js",
package/src/index.ts CHANGED
@@ -19,7 +19,7 @@ let fallback: Translation;
19
19
  // Watch for changes on <html lang>
20
20
  documentElementObserver.observe(document.documentElement, {
21
21
  attributes: true,
22
- attributeFilter: ['lang']
22
+ attributeFilter: ['dir', 'lang']
23
23
  });
24
24
 
25
25
  //
@@ -118,9 +118,10 @@ export function update() {
118
118
  //
119
119
  // private localize = new LocalizeController(this);
120
120
  //
121
- // This will add the element to the set and make it respond to changes to <html lang> automatically. To make it respond
122
- // to changes to its own lang property, make it a property:
121
+ // This will add the element to the set and make it respond to changes to <html dir|lang> automatically. To make it
122
+ // respond to changes to its own dir|lang properties, make it a property:
123
123
  //
124
+ // @property() dir: string;
124
125
  // @property() lang: string;
125
126
  //
126
127
  // To use a translation method, call it like this: