ember-css-modules 2.0.0 → 2.1.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/htmlbars-plugin/index.js +12 -3
- package/package.json +1 -1
- package/template-registry.d.ts +15 -0
|
@@ -142,9 +142,18 @@ module.exports = class ClassTransformPlugin {
|
|
|
142
142
|
|
|
143
143
|
utils.pushAll(parts, this.localToPath(localClassAttr.value));
|
|
144
144
|
this.divide(parts, 'text');
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
);
|
|
145
|
+
|
|
146
|
+
let newClassAttr = this.builders.attr('class', this.builders.concat(parts));
|
|
147
|
+
node.attributes.unshift(newClassAttr);
|
|
148
|
+
|
|
149
|
+
// In new-enough versions of Ember (>= 3.25 or so), we need to create a
|
|
150
|
+
// fake good-enough `loc` whose content will start with `class=` to avoid
|
|
151
|
+
// triggering https://github.com/emberjs/ember.js/issues/19392
|
|
152
|
+
if (typeof localClassAttr.loc.slice === 'function') {
|
|
153
|
+
newClassAttr.loc = localClassAttr.loc.slice({
|
|
154
|
+
skipStart: 'local-'.length,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
148
157
|
}
|
|
149
158
|
|
|
150
159
|
localToPath(node) {
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HelperLike } from '@glint/template';
|
|
2
|
+
|
|
3
|
+
interface Signature {
|
|
4
|
+
Args: {
|
|
5
|
+
Positional: [string];
|
|
6
|
+
Named: {
|
|
7
|
+
from?: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
Return: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default interface EmberCssModulesRegistry {
|
|
14
|
+
'local-class': HelperLike<Signature>;
|
|
15
|
+
}
|