ember-container-query 6.0.3 → 6.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/declarations/components/container-query.d.ts +1 -1
- package/declarations/helpers/aspect-ratio.d.ts +6 -12
- package/declarations/helpers/height.d.ts +6 -12
- package/declarations/helpers/width.d.ts +6 -12
- package/declarations/modifiers/container-query.d.ts +4 -4
- package/dist/components/container-query.js +4 -4
- package/dist/helpers/aspect-ratio.js +5 -7
- package/dist/helpers/height.js +5 -7
- package/dist/helpers/width.js +5 -7
- package/dist/modifiers/container-query.js +3 -3
- package/package.json +21 -20
|
@@ -18,7 +18,7 @@ interface ContainerQuerySignature<T extends IndexSignatureParameter> {
|
|
|
18
18
|
};
|
|
19
19
|
Element: Element;
|
|
20
20
|
}
|
|
21
|
-
export default class
|
|
21
|
+
export default class ContainerQuery<T extends IndexSignatureParameter> extends Component<ContainerQuerySignature<T>> {
|
|
22
22
|
dimensions?: Dimensions;
|
|
23
23
|
queryResults?: QueryResults<T>;
|
|
24
24
|
tagName: string;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import type { Metadata } from '../modifiers/container-query.ts';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Positional: [];
|
|
9
|
-
};
|
|
10
|
-
Return: Metadata;
|
|
11
|
-
}
|
|
12
|
-
declare const AspectRatioHelper: import("@ember/component/helper").FunctionBasedHelper<AspectRatioHelperSignature>;
|
|
13
|
-
export default AspectRatioHelper;
|
|
2
|
+
type Named = {
|
|
3
|
+
max?: number;
|
|
4
|
+
min?: number;
|
|
5
|
+
};
|
|
6
|
+
export default function aspectRatio(named?: Named): Metadata;
|
|
7
|
+
export {};
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import type { Metadata } from '../modifiers/container-query.ts';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Positional: [];
|
|
9
|
-
};
|
|
10
|
-
Return: Metadata;
|
|
11
|
-
}
|
|
12
|
-
declare const HeightHelper: import("@ember/component/helper").FunctionBasedHelper<HeightHelperSignature>;
|
|
13
|
-
export default HeightHelper;
|
|
2
|
+
type Named = {
|
|
3
|
+
max?: number;
|
|
4
|
+
min?: number;
|
|
5
|
+
};
|
|
6
|
+
export default function height(named?: Named): Metadata;
|
|
7
|
+
export {};
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import type { Metadata } from '../modifiers/container-query.ts';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Positional: [];
|
|
9
|
-
};
|
|
10
|
-
Return: Metadata;
|
|
11
|
-
}
|
|
12
|
-
declare const WidthHelper: import("@ember/component/helper").FunctionBasedHelper<WidthHelperSignature>;
|
|
13
|
-
export default WidthHelper;
|
|
2
|
+
type Named = {
|
|
3
|
+
max?: number;
|
|
4
|
+
min?: number;
|
|
5
|
+
};
|
|
6
|
+
export default function width(named?: Named): Metadata;
|
|
7
|
+
export {};
|
|
@@ -14,7 +14,7 @@ type Metadata = {
|
|
|
14
14
|
};
|
|
15
15
|
type Features<T extends IndexSignatureParameter> = Record<T, Metadata>;
|
|
16
16
|
type QueryResults<T extends IndexSignatureParameter> = Record<T, boolean>;
|
|
17
|
-
interface
|
|
17
|
+
interface ContainerQuerySignature<T extends IndexSignatureParameter> {
|
|
18
18
|
Args: {
|
|
19
19
|
Named: {
|
|
20
20
|
dataAttributePrefix?: string;
|
|
@@ -29,7 +29,7 @@ interface ContainerQueryModifierSignature<T extends IndexSignatureParameter> {
|
|
|
29
29
|
};
|
|
30
30
|
Element: Element;
|
|
31
31
|
}
|
|
32
|
-
export default class
|
|
32
|
+
export default class ContainerQuery<T extends IndexSignatureParameter> extends Modifier<ContainerQuerySignature<T>> {
|
|
33
33
|
private readonly resizeObserver;
|
|
34
34
|
private _dataAttributes;
|
|
35
35
|
private _element?;
|
|
@@ -39,10 +39,10 @@ export default class ContainerQueryModifier<T extends IndexSignatureParameter> e
|
|
|
39
39
|
get dataAttributePrefix(): string;
|
|
40
40
|
get debounce(): number;
|
|
41
41
|
get features(): Features<T>;
|
|
42
|
-
constructor(owner: Owner, args: ArgsFor<
|
|
42
|
+
constructor(owner: Owner, args: ArgsFor<ContainerQuerySignature<T>>);
|
|
43
43
|
private evaluateQueries;
|
|
44
44
|
private measureDimensions;
|
|
45
|
-
modify(element: Element, _positional: PositionalArgs<
|
|
45
|
+
modify(element: Element, _positional: PositionalArgs<ContainerQuerySignature<T>>, named: NamedArgs<ContainerQuerySignature<T>>): void;
|
|
46
46
|
private queryContainer;
|
|
47
47
|
private registerResizeObserver;
|
|
48
48
|
private resetDataAttributes;
|
|
@@ -3,14 +3,14 @@ import { hash } from '@ember/helper';
|
|
|
3
3
|
import Component from '@glimmer/component';
|
|
4
4
|
import { tracked } from '@glimmer/tracking';
|
|
5
5
|
import { element } from 'ember-element-helper';
|
|
6
|
-
import
|
|
6
|
+
import ContainerQuery$1 from '../modifiers/container-query.js';
|
|
7
7
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
8
8
|
import { setComponentTemplate } from '@ember/component';
|
|
9
9
|
import { g, i } from 'decorator-transforms/runtime';
|
|
10
10
|
|
|
11
11
|
;
|
|
12
12
|
|
|
13
|
-
class
|
|
13
|
+
class ContainerQuery extends Component {
|
|
14
14
|
static {
|
|
15
15
|
g(this.prototype, "dimensions", [tracked]);
|
|
16
16
|
}
|
|
@@ -33,12 +33,12 @@ class ContainerQueryComponent extends Component {
|
|
|
33
33
|
strictMode: true,
|
|
34
34
|
scope: () => ({
|
|
35
35
|
element,
|
|
36
|
-
containerQuery:
|
|
36
|
+
containerQuery: ContainerQuery$1,
|
|
37
37
|
hash
|
|
38
38
|
})
|
|
39
39
|
}), this);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export {
|
|
43
|
+
export { ContainerQuery as default };
|
|
44
44
|
//# sourceMappingURL=container-query.js.map
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const AspectRatioHelper = helper((_positional, named) => {
|
|
2
|
+
function aspectRatio(named) {
|
|
5
3
|
const dimension = 'aspectRatio';
|
|
6
|
-
const max = named
|
|
7
|
-
const min = named
|
|
4
|
+
const max = named?.max ?? Infinity;
|
|
5
|
+
const min = named?.min ?? 0;
|
|
8
6
|
return {
|
|
9
7
|
dimension,
|
|
10
8
|
max,
|
|
11
9
|
min
|
|
12
10
|
};
|
|
13
|
-
}
|
|
11
|
+
}
|
|
14
12
|
|
|
15
|
-
export {
|
|
13
|
+
export { aspectRatio as default };
|
|
16
14
|
//# sourceMappingURL=aspect-ratio.js.map
|
package/dist/helpers/height.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const HeightHelper = helper((_positional, named) => {
|
|
2
|
+
function height(named) {
|
|
5
3
|
const dimension = 'height';
|
|
6
|
-
const max = named
|
|
7
|
-
const min = named
|
|
4
|
+
const max = named?.max ?? Infinity;
|
|
5
|
+
const min = named?.min ?? 0;
|
|
8
6
|
return {
|
|
9
7
|
dimension,
|
|
10
8
|
max,
|
|
11
9
|
min
|
|
12
10
|
};
|
|
13
|
-
}
|
|
11
|
+
}
|
|
14
12
|
|
|
15
|
-
export {
|
|
13
|
+
export { height as default };
|
|
16
14
|
//# sourceMappingURL=height.js.map
|
package/dist/helpers/width.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const WidthHelper = helper((_positional, named) => {
|
|
2
|
+
function width(named) {
|
|
5
3
|
const dimension = 'width';
|
|
6
|
-
const max = named
|
|
7
|
-
const min = named
|
|
4
|
+
const max = named?.max ?? Infinity;
|
|
5
|
+
const min = named?.min ?? 0;
|
|
8
6
|
return {
|
|
9
7
|
dimension,
|
|
10
8
|
max,
|
|
11
9
|
min
|
|
12
10
|
};
|
|
13
|
-
}
|
|
11
|
+
}
|
|
14
12
|
|
|
15
|
-
export {
|
|
13
|
+
export { width as default };
|
|
16
14
|
//# sourceMappingURL=width.js.map
|
|
@@ -6,7 +6,7 @@ import { service } from '@ember/service';
|
|
|
6
6
|
import Modifier from 'ember-modifier';
|
|
7
7
|
import { g, i, n } from 'decorator-transforms/runtime';
|
|
8
8
|
|
|
9
|
-
class
|
|
9
|
+
let ContainerQuery$1 = class ContainerQuery extends Modifier {
|
|
10
10
|
static {
|
|
11
11
|
g(this.prototype, "resizeObserver", [service]);
|
|
12
12
|
}
|
|
@@ -102,7 +102,7 @@ class ContainerQueryModifier extends Modifier {
|
|
|
102
102
|
static {
|
|
103
103
|
n(this.prototype, "onResize", [action]);
|
|
104
104
|
}
|
|
105
|
-
}
|
|
105
|
+
};
|
|
106
106
|
|
|
107
|
-
export {
|
|
107
|
+
export { ContainerQuery$1 as default };
|
|
108
108
|
//# sourceMappingURL=container-query.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-container-query",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Make container queries that harness the power of Ember",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"container-queries",
|
|
@@ -47,9 +47,23 @@
|
|
|
47
47
|
"declarations",
|
|
48
48
|
"dist"
|
|
49
49
|
],
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "rollup --config",
|
|
52
|
+
"format": "prettier . --cache --write",
|
|
53
|
+
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
|
|
54
|
+
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" && pnpm format",
|
|
55
|
+
"lint:format": "prettier . --cache --check",
|
|
56
|
+
"lint:hbs": "ember-template-lint .",
|
|
57
|
+
"lint:hbs:fix": "ember-template-lint . --fix",
|
|
58
|
+
"lint:js": "eslint . --cache",
|
|
59
|
+
"lint:js:fix": "eslint . --fix",
|
|
60
|
+
"lint:types": "glint",
|
|
61
|
+
"prepack": "rollup --config",
|
|
62
|
+
"start": "rollup --config --watch",
|
|
63
|
+
"test": "echo \"A v2 addon does not have tests, run tests in test-app\""
|
|
64
|
+
},
|
|
50
65
|
"dependencies": {
|
|
51
66
|
"@embroider/addon-shim": "^1.10.0",
|
|
52
|
-
"@glimmer/component": "^2.0.0",
|
|
53
67
|
"decorator-transforms": "^2.3.0",
|
|
54
68
|
"ember-element-helper": "^0.8.8",
|
|
55
69
|
"ember-modifier": "^4.2.2",
|
|
@@ -60,13 +74,14 @@
|
|
|
60
74
|
"@babel/plugin-transform-typescript": "^7.28.0",
|
|
61
75
|
"@babel/runtime": "^7.28.4",
|
|
62
76
|
"@embroider/addon-dev": "^8.1.0",
|
|
77
|
+
"@glimmer/component": "^2.0.0",
|
|
63
78
|
"@glimmer/tracking": "^1.1.2",
|
|
64
79
|
"@glint/core": "^1.5.2",
|
|
65
80
|
"@glint/environment-ember-loose": "^1.5.2",
|
|
66
81
|
"@glint/environment-ember-template-imports": "^1.5.2",
|
|
67
82
|
"@glint/template": "^1.5.2",
|
|
68
83
|
"@ijlee2-frontend-configs/ember-template-lint": "^2.2.0",
|
|
69
|
-
"@ijlee2-frontend-configs/eslint-config-ember": "^2.
|
|
84
|
+
"@ijlee2-frontend-configs/eslint-config-ember": "^2.3.0",
|
|
70
85
|
"@ijlee2-frontend-configs/prettier": "^2.2.0",
|
|
71
86
|
"@rollup/plugin-babel": "^6.0.4",
|
|
72
87
|
"@tsconfig/ember": "^3.0.11",
|
|
@@ -76,8 +91,8 @@
|
|
|
76
91
|
"ember-template-lint": "^7.9.3",
|
|
77
92
|
"eslint": "^9.36.0",
|
|
78
93
|
"prettier": "^3.6.2",
|
|
79
|
-
"rollup": "^4.52.
|
|
80
|
-
"typescript": "^5.9.
|
|
94
|
+
"rollup": "^4.52.4",
|
|
95
|
+
"typescript": "^5.9.3"
|
|
81
96
|
},
|
|
82
97
|
"engines": {
|
|
83
98
|
"node": "20.* || >= 22"
|
|
@@ -96,19 +111,5 @@
|
|
|
96
111
|
"main": "addon-main.cjs",
|
|
97
112
|
"type": "addon",
|
|
98
113
|
"version": 2
|
|
99
|
-
},
|
|
100
|
-
"scripts": {
|
|
101
|
-
"build": "rollup --config",
|
|
102
|
-
"format": "prettier . --cache --write",
|
|
103
|
-
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
|
|
104
|
-
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\" && pnpm format",
|
|
105
|
-
"lint:format": "prettier . --cache --check",
|
|
106
|
-
"lint:hbs": "ember-template-lint .",
|
|
107
|
-
"lint:hbs:fix": "ember-template-lint . --fix",
|
|
108
|
-
"lint:js": "eslint . --cache",
|
|
109
|
-
"lint:js:fix": "eslint . --fix",
|
|
110
|
-
"lint:types": "glint",
|
|
111
|
-
"start": "rollup --config --watch",
|
|
112
|
-
"test": "echo \"A v2 addon does not have tests, run tests in test-app\""
|
|
113
114
|
}
|
|
114
|
-
}
|
|
115
|
+
}
|