@praxisjs/css 0.3.4 → 0.3.5
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 +22 -0
- package/dist/builder/css-builder.d.ts.map +1 -1
- package/dist/builder/css-builder.js +68 -74
- package/dist/builder/css-builder.js.map +1 -1
- package/dist/builder/keyframes.d.ts +5 -0
- package/dist/builder/keyframes.d.ts.map +1 -1
- package/dist/builder/keyframes.js +12 -14
- package/dist/builder/keyframes.js.map +1 -1
- package/dist/cx.d.ts.map +1 -1
- package/dist/cx.js +23 -18
- package/dist/cx.js.map +1 -1
- package/dist/decorators/param.d.ts +1 -2
- package/dist/decorators/param.d.ts.map +1 -1
- package/dist/decorators/param.js +9 -17
- package/dist/decorators/param.js.map +1 -1
- package/dist/decorators/style.d.ts.map +1 -1
- package/dist/decorators/style.js +61 -33
- package/dist/decorators/style.js.map +1 -1
- package/dist/decorators/styled.d.ts.map +1 -1
- package/dist/decorators/styled.js +112 -95
- package/dist/decorators/styled.js.map +1 -1
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +19 -35
- package/dist/extract.js.map +1 -1
- package/dist/global.d.ts +3 -0
- package/dist/global.d.ts.map +1 -1
- package/dist/global.js +9 -4
- package/dist/global.js.map +1 -1
- package/dist/internal/kebab.d.ts +5 -0
- package/dist/internal/kebab.d.ts.map +1 -0
- package/dist/internal/kebab.js +23 -0
- package/dist/internal/kebab.js.map +1 -0
- package/dist/internal/lifecycle.d.ts +15 -0
- package/dist/internal/lifecycle.d.ts.map +1 -0
- package/dist/internal/lifecycle.js +16 -0
- package/dist/internal/lifecycle.js.map +1 -0
- package/dist/internal/registry.d.ts +5 -1
- package/dist/internal/registry.d.ts.map +1 -1
- package/dist/internal/registry.js +9 -23
- package/dist/internal/registry.js.map +1 -1
- package/dist/internal/sheet.d.ts +20 -0
- package/dist/internal/sheet.d.ts.map +1 -0
- package/dist/internal/sheet.js +56 -0
- package/dist/internal/sheet.js.map +1 -0
- package/dist/internal/static-mode.d.ts +2 -0
- package/dist/internal/static-mode.d.ts.map +1 -0
- package/dist/internal/static-mode.js +2 -0
- package/dist/internal/static-mode.js.map +1 -0
- package/dist/preflight.d.ts +3 -1
- package/dist/preflight.d.ts.map +1 -1
- package/dist/preflight.js +7 -3
- package/dist/preflight.js.map +1 -1
- package/dist/tokens/decorators.d.ts.map +1 -1
- package/dist/tokens/decorators.js +13 -4
- package/dist/tokens/decorators.js.map +1 -1
- package/dist/tokens/theme-instance.d.ts +5 -0
- package/dist/tokens/theme-instance.d.ts.map +1 -1
- package/dist/tokens/theme-instance.js +25 -17
- package/dist/tokens/theme-instance.js.map +1 -1
- package/dist/tokens/token-sheet.d.ts.map +1 -1
- package/dist/tokens/token-sheet.js +12 -9
- package/dist/tokens/token-sheet.js.map +1 -1
- package/package.json +13 -5
- package/src/builder/css-builder.ts +79 -83
- package/src/builder/keyframes.ts +12 -20
- package/src/cx.ts +20 -13
- package/src/decorators/param.ts +12 -16
- package/src/decorators/style.ts +79 -35
- package/src/decorators/styled.ts +127 -111
- package/src/extract.ts +18 -34
- package/src/global.ts +10 -9
- package/src/internal/kebab.ts +23 -0
- package/src/internal/lifecycle.ts +21 -0
- package/src/internal/registry.ts +9 -35
- package/src/internal/sheet.ts +71 -0
- package/src/internal/static-mode.ts +6 -0
- package/src/preflight.ts +8 -3
- package/src/tokens/decorators.ts +15 -3
- package/src/tokens/theme-instance.ts +26 -16
- package/src/tokens/token-sheet.ts +12 -12
- package/dist/__tests__/css-builder.test.d.ts +0 -2
- package/dist/__tests__/css-builder.test.d.ts.map +0 -1
- package/dist/__tests__/css-builder.test.js +0 -198
- package/dist/__tests__/css-builder.test.js.map +0 -1
- package/dist/__tests__/cx.test.d.ts +0 -2
- package/dist/__tests__/cx.test.d.ts.map +0 -1
- package/dist/__tests__/cx.test.js +0 -47
- package/dist/__tests__/cx.test.js.map +0 -1
- package/dist/__tests__/decorators.test.d.ts +0 -2
- package/dist/__tests__/decorators.test.d.ts.map +0 -1
- package/dist/__tests__/decorators.test.js +0 -264
- package/dist/__tests__/decorators.test.js.map +0 -1
- package/dist/__tests__/extract.test.d.ts +0 -2
- package/dist/__tests__/extract.test.d.ts.map +0 -1
- package/dist/__tests__/extract.test.js +0 -416
- package/dist/__tests__/extract.test.js.map +0 -1
- package/dist/__tests__/global.test.d.ts +0 -2
- package/dist/__tests__/global.test.d.ts.map +0 -1
- package/dist/__tests__/global.test.js +0 -136
- package/dist/__tests__/global.test.js.map +0 -1
- package/dist/__tests__/keyframes.test.d.ts +0 -2
- package/dist/__tests__/keyframes.test.d.ts.map +0 -1
- package/dist/__tests__/keyframes.test.js +0 -90
- package/dist/__tests__/keyframes.test.js.map +0 -1
- package/dist/__tests__/preflight.test.d.ts +0 -2
- package/dist/__tests__/preflight.test.d.ts.map +0 -1
- package/dist/__tests__/preflight.test.js +0 -74
- package/dist/__tests__/preflight.test.js.map +0 -1
- package/dist/__tests__/registry.test.d.ts +0 -2
- package/dist/__tests__/registry.test.d.ts.map +0 -1
- package/dist/__tests__/registry.test.js +0 -132
- package/dist/__tests__/registry.test.js.map +0 -1
- package/dist/__tests__/style.test.d.ts +0 -2
- package/dist/__tests__/style.test.d.ts.map +0 -1
- package/dist/__tests__/style.test.js +0 -281
- package/dist/__tests__/style.test.js.map +0 -1
- package/dist/__tests__/styled.test.d.ts +0 -2
- package/dist/__tests__/styled.test.d.ts.map +0 -1
- package/dist/__tests__/styled.test.js +0 -904
- package/dist/__tests__/styled.test.js.map +0 -1
- package/dist/__tests__/theme-instance.test.d.ts +0 -2
- package/dist/__tests__/theme-instance.test.d.ts.map +0 -1
- package/dist/__tests__/theme-instance.test.js +0 -309
- package/dist/__tests__/theme-instance.test.js.map +0 -1
- package/dist/__tests__/theme-uninit.test.d.ts +0 -2
- package/dist/__tests__/theme-uninit.test.d.ts.map +0 -1
- package/dist/__tests__/theme-uninit.test.js +0 -10
- package/dist/__tests__/theme-uninit.test.js.map +0 -1
- package/dist/__tests__/token-sheet.test.d.ts +0 -2
- package/dist/__tests__/token-sheet.test.d.ts.map +0 -1
- package/dist/__tests__/token-sheet.test.js +0 -74
- package/dist/__tests__/token-sheet.test.js.map +0 -1
- package/src/__tests__/css-builder.test.ts +0 -230
- package/src/__tests__/cx.test.ts +0 -63
- package/src/__tests__/decorators.test.ts +0 -127
- package/src/__tests__/extract.test.ts +0 -459
- package/src/__tests__/global.test.ts +0 -163
- package/src/__tests__/keyframes.test.ts +0 -103
- package/src/__tests__/preflight.test.ts +0 -85
- package/src/__tests__/registry.test.ts +0 -151
- package/src/__tests__/style.test.ts +0 -170
- package/src/__tests__/styled.test.ts +0 -443
- package/src/__tests__/theme-instance.test.ts +0 -374
- package/src/__tests__/theme-uninit.test.ts +0 -12
- package/src/__tests__/token-sheet.test.ts +0 -87
- package/tsconfig.json +0 -8
|
@@ -1,904 +0,0 @@
|
|
|
1
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
-
var _, done = false;
|
|
7
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
-
var context = {};
|
|
9
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
-
if (kind === "accessor") {
|
|
14
|
-
if (result === void 0) continue;
|
|
15
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
-
}
|
|
20
|
-
else if (_ = accept(result)) {
|
|
21
|
-
if (kind === "field") initializers.unshift(_);
|
|
22
|
-
else descriptor[key] = _;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
-
done = true;
|
|
27
|
-
};
|
|
28
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
-
var useValue = arguments.length > 2;
|
|
30
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
-
}
|
|
33
|
-
return useValue ? value : void 0;
|
|
34
|
-
};
|
|
35
|
-
// @vitest-environment jsdom
|
|
36
|
-
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
37
|
-
import { StatefulComponent } from "@praxisjs/core";
|
|
38
|
-
import { setComponentAnchor } from "@praxisjs/core/internal";
|
|
39
|
-
import { Component } from "@praxisjs/decorators";
|
|
40
|
-
import { Param } from "../decorators/param";
|
|
41
|
-
import { ReactiveStylesheet, Stylesheet } from "../base/stylesheet";
|
|
42
|
-
import { Styled } from "../decorators/styled";
|
|
43
|
-
beforeEach(() => {
|
|
44
|
-
document
|
|
45
|
-
.head
|
|
46
|
-
.querySelectorAll("style[data-praxis-hash]")
|
|
47
|
-
.forEach((el) => el.remove());
|
|
48
|
-
});
|
|
49
|
-
afterEach(() => {
|
|
50
|
-
document
|
|
51
|
-
.head
|
|
52
|
-
.querySelectorAll("style[data-praxis-hash]")
|
|
53
|
-
.forEach((el) => el.remove());
|
|
54
|
-
});
|
|
55
|
-
// ─── CSS class fields ($-prefixed) ────────────────────────────────────────────
|
|
56
|
-
class BtnStyle extends Stylesheet {
|
|
57
|
-
$base = `display: inline-flex; padding: 8px 16px;`;
|
|
58
|
-
$primary = `background: var(--accent); color: white;`;
|
|
59
|
-
}
|
|
60
|
-
describe("@Styled — $-prefixed CSS class fields", () => {
|
|
61
|
-
it("transforms $-fields to scoped class names", () => {
|
|
62
|
-
let Comp = (() => {
|
|
63
|
-
let _$btn_decorators;
|
|
64
|
-
let _$btn_initializers = [];
|
|
65
|
-
let _$btn_extraInitializers = [];
|
|
66
|
-
return class Comp {
|
|
67
|
-
static {
|
|
68
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
69
|
-
_$btn_decorators = [Styled(BtnStyle)];
|
|
70
|
-
__esDecorate(null, null, _$btn_decorators, { kind: "field", name: "$btn", static: false, private: false, access: { has: obj => "$btn" in obj, get: obj => obj.$btn, set: (obj, value) => { obj.$btn = value; } }, metadata: _metadata }, _$btn_initializers, _$btn_extraInitializers);
|
|
71
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
72
|
-
}
|
|
73
|
-
$btn = __runInitializers(this, _$btn_initializers, void 0);
|
|
74
|
-
constructor() {
|
|
75
|
-
__runInitializers(this, _$btn_extraInitializers);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
})();
|
|
79
|
-
const { $btn } = new Comp();
|
|
80
|
-
expect($btn.$base).toMatch(/^prx-base-/);
|
|
81
|
-
expect($btn.$primary).toMatch(/^prx-primary-/);
|
|
82
|
-
});
|
|
83
|
-
it("class names are distinct for distinct CSS", () => {
|
|
84
|
-
let Comp = (() => {
|
|
85
|
-
let _$btn_decorators;
|
|
86
|
-
let _$btn_initializers = [];
|
|
87
|
-
let _$btn_extraInitializers = [];
|
|
88
|
-
return class Comp {
|
|
89
|
-
static {
|
|
90
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
91
|
-
_$btn_decorators = [Styled(BtnStyle)];
|
|
92
|
-
__esDecorate(null, null, _$btn_decorators, { kind: "field", name: "$btn", static: false, private: false, access: { has: obj => "$btn" in obj, get: obj => obj.$btn, set: (obj, value) => { obj.$btn = value; } }, metadata: _metadata }, _$btn_initializers, _$btn_extraInitializers);
|
|
93
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
94
|
-
}
|
|
95
|
-
$btn = __runInitializers(this, _$btn_initializers, void 0);
|
|
96
|
-
constructor() {
|
|
97
|
-
__runInitializers(this, _$btn_extraInitializers);
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
})();
|
|
101
|
-
const { $btn } = new Comp();
|
|
102
|
-
expect($btn.$base).not.toBe($btn.$primary);
|
|
103
|
-
});
|
|
104
|
-
it("same CSS content produces the same hash suffix across different keys", () => {
|
|
105
|
-
class SA extends Stylesheet {
|
|
106
|
-
$x = `color: red;`;
|
|
107
|
-
}
|
|
108
|
-
class SB extends Stylesheet {
|
|
109
|
-
$y = `color: red;`;
|
|
110
|
-
}
|
|
111
|
-
const hashA = new ((() => {
|
|
112
|
-
let _$a_decorators;
|
|
113
|
-
let _$a_initializers = [];
|
|
114
|
-
let _$a_extraInitializers = [];
|
|
115
|
-
return class {
|
|
116
|
-
static {
|
|
117
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
118
|
-
_$a_decorators = [Styled(SA)];
|
|
119
|
-
__esDecorate(null, null, _$a_decorators, { kind: "field", name: "$a", static: false, private: false, access: { has: obj => "$a" in obj, get: obj => obj.$a, set: (obj, value) => { obj.$a = value; } }, metadata: _metadata }, _$a_initializers, _$a_extraInitializers);
|
|
120
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
121
|
-
}
|
|
122
|
-
$a = __runInitializers(this, _$a_initializers, void 0);
|
|
123
|
-
constructor() {
|
|
124
|
-
__runInitializers(this, _$a_extraInitializers);
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
})())().$a.$x.split("-").pop();
|
|
128
|
-
const hashB = new ((() => {
|
|
129
|
-
let _$b_decorators;
|
|
130
|
-
let _$b_initializers = [];
|
|
131
|
-
let _$b_extraInitializers = [];
|
|
132
|
-
return class {
|
|
133
|
-
static {
|
|
134
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
135
|
-
_$b_decorators = [Styled(SB)];
|
|
136
|
-
__esDecorate(null, null, _$b_decorators, { kind: "field", name: "$b", static: false, private: false, access: { has: obj => "$b" in obj, get: obj => obj.$b, set: (obj, value) => { obj.$b = value; } }, metadata: _metadata }, _$b_initializers, _$b_extraInitializers);
|
|
137
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
138
|
-
}
|
|
139
|
-
$b = __runInitializers(this, _$b_initializers, void 0);
|
|
140
|
-
constructor() {
|
|
141
|
-
__runInitializers(this, _$b_extraInitializers);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
})())().$b.$y.split("-").pop();
|
|
145
|
-
expect(hashA).toBe(hashB);
|
|
146
|
-
});
|
|
147
|
-
it("caches the class map — same object reference across instances", () => {
|
|
148
|
-
let Comp = (() => {
|
|
149
|
-
let _$btn_decorators;
|
|
150
|
-
let _$btn_initializers = [];
|
|
151
|
-
let _$btn_extraInitializers = [];
|
|
152
|
-
return class Comp {
|
|
153
|
-
static {
|
|
154
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
155
|
-
_$btn_decorators = [Styled(BtnStyle)];
|
|
156
|
-
__esDecorate(null, null, _$btn_decorators, { kind: "field", name: "$btn", static: false, private: false, access: { has: obj => "$btn" in obj, get: obj => obj.$btn, set: (obj, value) => { obj.$btn = value; } }, metadata: _metadata }, _$btn_initializers, _$btn_extraInitializers);
|
|
157
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
158
|
-
}
|
|
159
|
-
$btn = __runInitializers(this, _$btn_initializers, void 0);
|
|
160
|
-
constructor() {
|
|
161
|
-
__runInitializers(this, _$btn_extraInitializers);
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
})();
|
|
165
|
-
expect(new Comp().$btn).toBe(new Comp().$btn);
|
|
166
|
-
});
|
|
167
|
-
it("injects a style element into document.head eagerly at decoration time", () => {
|
|
168
|
-
// Before any class definition: no style element
|
|
169
|
-
expect(document.head.querySelector("style[data-praxis-hash]")).toBeNull();
|
|
170
|
-
// Defining a class with @Styled injects immediately (before any mount)
|
|
171
|
-
let Comp = (() => {
|
|
172
|
-
let _$btn_decorators;
|
|
173
|
-
let _$btn_initializers = [];
|
|
174
|
-
let _$btn_extraInitializers = [];
|
|
175
|
-
return class Comp {
|
|
176
|
-
static {
|
|
177
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
178
|
-
_$btn_decorators = [Styled(BtnStyle)];
|
|
179
|
-
__esDecorate(null, null, _$btn_decorators, { kind: "field", name: "$btn", static: false, private: false, access: { has: obj => "$btn" in obj, get: obj => obj.$btn, set: (obj, value) => { obj.$btn = value; } }, metadata: _metadata }, _$btn_initializers, _$btn_extraInitializers);
|
|
180
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
181
|
-
}
|
|
182
|
-
$btn = __runInitializers(this, _$btn_initializers, void 0);
|
|
183
|
-
constructor() {
|
|
184
|
-
__runInitializers(this, _$btn_extraInitializers);
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
})();
|
|
188
|
-
expect(document.head.querySelector("style[data-praxis-hash]")).not.toBeNull();
|
|
189
|
-
// Style is present even before instantiation or mount
|
|
190
|
-
void Comp;
|
|
191
|
-
});
|
|
192
|
-
it("style is present before onMount is called", () => {
|
|
193
|
-
let Comp = (() => {
|
|
194
|
-
let _$btn_decorators;
|
|
195
|
-
let _$btn_initializers = [];
|
|
196
|
-
let _$btn_extraInitializers = [];
|
|
197
|
-
return class Comp {
|
|
198
|
-
static {
|
|
199
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
200
|
-
_$btn_decorators = [Styled(BtnStyle)];
|
|
201
|
-
__esDecorate(null, null, _$btn_decorators, { kind: "field", name: "$btn", static: false, private: false, access: { has: obj => "$btn" in obj, get: obj => obj.$btn, set: (obj, value) => { obj.$btn = value; } }, metadata: _metadata }, _$btn_initializers, _$btn_extraInitializers);
|
|
202
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
203
|
-
}
|
|
204
|
-
$btn = __runInitializers(this, _$btn_initializers, void 0);
|
|
205
|
-
constructor() {
|
|
206
|
-
__runInitializers(this, _$btn_extraInitializers);
|
|
207
|
-
}
|
|
208
|
-
};
|
|
209
|
-
})();
|
|
210
|
-
// Style injected at decoration time — no mount needed
|
|
211
|
-
expect(document.head.querySelector("style[data-praxis-hash]")).not.toBeNull();
|
|
212
|
-
const inst = new Comp();
|
|
213
|
-
// Still present before mount
|
|
214
|
-
expect(document.head.querySelector("style[data-praxis-hash]")).not.toBeNull();
|
|
215
|
-
inst.onMount?.();
|
|
216
|
-
expect(document.head.querySelector("style[data-praxis-hash]")).not.toBeNull();
|
|
217
|
-
});
|
|
218
|
-
it("injected CSS contains the generated class names", () => {
|
|
219
|
-
let Comp = (() => {
|
|
220
|
-
let _$btn_decorators;
|
|
221
|
-
let _$btn_initializers = [];
|
|
222
|
-
let _$btn_extraInitializers = [];
|
|
223
|
-
return class Comp {
|
|
224
|
-
static {
|
|
225
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
226
|
-
_$btn_decorators = [Styled(BtnStyle)];
|
|
227
|
-
__esDecorate(null, null, _$btn_decorators, { kind: "field", name: "$btn", static: false, private: false, access: { has: obj => "$btn" in obj, get: obj => obj.$btn, set: (obj, value) => { obj.$btn = value; } }, metadata: _metadata }, _$btn_initializers, _$btn_extraInitializers);
|
|
228
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
229
|
-
}
|
|
230
|
-
$btn = __runInitializers(this, _$btn_initializers, void 0);
|
|
231
|
-
constructor() {
|
|
232
|
-
__runInitializers(this, _$btn_extraInitializers);
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
})();
|
|
236
|
-
const css = document.head.querySelector("style[data-praxis-hash]")?.textContent ?? "";
|
|
237
|
-
expect(css).toContain(new Comp().$btn.$base);
|
|
238
|
-
});
|
|
239
|
-
it("reference-counts — injects once for multiple instances", () => {
|
|
240
|
-
let Comp = (() => {
|
|
241
|
-
let _$btn_decorators;
|
|
242
|
-
let _$btn_initializers = [];
|
|
243
|
-
let _$btn_extraInitializers = [];
|
|
244
|
-
return class Comp {
|
|
245
|
-
static {
|
|
246
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
247
|
-
_$btn_decorators = [Styled(BtnStyle)];
|
|
248
|
-
__esDecorate(null, null, _$btn_decorators, { kind: "field", name: "$btn", static: false, private: false, access: { has: obj => "$btn" in obj, get: obj => obj.$btn, set: (obj, value) => { obj.$btn = value; } }, metadata: _metadata }, _$btn_initializers, _$btn_extraInitializers);
|
|
249
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
250
|
-
}
|
|
251
|
-
$btn = __runInitializers(this, _$btn_initializers, void 0);
|
|
252
|
-
constructor() {
|
|
253
|
-
__runInitializers(this, _$btn_extraInitializers);
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
})();
|
|
257
|
-
const i1 = new Comp();
|
|
258
|
-
const i2 = new Comp();
|
|
259
|
-
i1.onMount?.();
|
|
260
|
-
i2.onMount?.();
|
|
261
|
-
expect(document.head.querySelectorAll("style[data-praxis-hash]").length).toBe(1);
|
|
262
|
-
});
|
|
263
|
-
it("style persists after all instances unmount (decoration-time base reference)", () => {
|
|
264
|
-
// The eager injection at decoration time holds a permanent reference.
|
|
265
|
-
// Unmounting all instances decrements their ref-count but does not remove the style.
|
|
266
|
-
let Comp = (() => {
|
|
267
|
-
let _$btn_decorators;
|
|
268
|
-
let _$btn_initializers = [];
|
|
269
|
-
let _$btn_extraInitializers = [];
|
|
270
|
-
return class Comp {
|
|
271
|
-
static {
|
|
272
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
273
|
-
_$btn_decorators = [Styled(BtnStyle)];
|
|
274
|
-
__esDecorate(null, null, _$btn_decorators, { kind: "field", name: "$btn", static: false, private: false, access: { has: obj => "$btn" in obj, get: obj => obj.$btn, set: (obj, value) => { obj.$btn = value; } }, metadata: _metadata }, _$btn_initializers, _$btn_extraInitializers);
|
|
275
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
276
|
-
}
|
|
277
|
-
$btn = __runInitializers(this, _$btn_initializers, void 0);
|
|
278
|
-
constructor() {
|
|
279
|
-
__runInitializers(this, _$btn_extraInitializers);
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
})();
|
|
283
|
-
const inst = new Comp();
|
|
284
|
-
inst.onMount?.();
|
|
285
|
-
inst.onUnmount?.();
|
|
286
|
-
expect(document.head.querySelector("style[data-praxis-hash]")).not.toBeNull();
|
|
287
|
-
});
|
|
288
|
-
it("keeps style when one of two instances unmounts", () => {
|
|
289
|
-
let Comp = (() => {
|
|
290
|
-
let _$btn_decorators;
|
|
291
|
-
let _$btn_initializers = [];
|
|
292
|
-
let _$btn_extraInitializers = [];
|
|
293
|
-
return class Comp {
|
|
294
|
-
static {
|
|
295
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
296
|
-
_$btn_decorators = [Styled(BtnStyle)];
|
|
297
|
-
__esDecorate(null, null, _$btn_decorators, { kind: "field", name: "$btn", static: false, private: false, access: { has: obj => "$btn" in obj, get: obj => obj.$btn, set: (obj, value) => { obj.$btn = value; } }, metadata: _metadata }, _$btn_initializers, _$btn_extraInitializers);
|
|
298
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
299
|
-
}
|
|
300
|
-
$btn = __runInitializers(this, _$btn_initializers, void 0);
|
|
301
|
-
constructor() {
|
|
302
|
-
__runInitializers(this, _$btn_extraInitializers);
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
})();
|
|
306
|
-
const i1 = new Comp();
|
|
307
|
-
const i2 = new Comp();
|
|
308
|
-
i1.onMount?.();
|
|
309
|
-
i2.onMount?.();
|
|
310
|
-
i1.onUnmount?.();
|
|
311
|
-
expect(document.head.querySelector("style[data-praxis-hash]")).not.toBeNull();
|
|
312
|
-
i2.onUnmount?.();
|
|
313
|
-
expect(document.head.querySelector("style[data-praxis-hash]")).not.toBeNull();
|
|
314
|
-
});
|
|
315
|
-
it("multiple @Styled fields inject separate stylesheets", () => {
|
|
316
|
-
class SA extends Stylesheet {
|
|
317
|
-
$foo = `color: tomato;`;
|
|
318
|
-
}
|
|
319
|
-
class SB extends Stylesheet {
|
|
320
|
-
$bar = `color: steelblue;`;
|
|
321
|
-
}
|
|
322
|
-
let Comp = (() => {
|
|
323
|
-
let _$a_decorators;
|
|
324
|
-
let _$a_initializers = [];
|
|
325
|
-
let _$a_extraInitializers = [];
|
|
326
|
-
let _$b_decorators;
|
|
327
|
-
let _$b_initializers = [];
|
|
328
|
-
let _$b_extraInitializers = [];
|
|
329
|
-
return class Comp {
|
|
330
|
-
static {
|
|
331
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
332
|
-
_$a_decorators = [Styled(SA)];
|
|
333
|
-
_$b_decorators = [Styled(SB)];
|
|
334
|
-
__esDecorate(null, null, _$a_decorators, { kind: "field", name: "$a", static: false, private: false, access: { has: obj => "$a" in obj, get: obj => obj.$a, set: (obj, value) => { obj.$a = value; } }, metadata: _metadata }, _$a_initializers, _$a_extraInitializers);
|
|
335
|
-
__esDecorate(null, null, _$b_decorators, { kind: "field", name: "$b", static: false, private: false, access: { has: obj => "$b" in obj, get: obj => obj.$b, set: (obj, value) => { obj.$b = value; } }, metadata: _metadata }, _$b_initializers, _$b_extraInitializers);
|
|
336
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
337
|
-
}
|
|
338
|
-
$a = __runInitializers(this, _$a_initializers, void 0);
|
|
339
|
-
$b = (__runInitializers(this, _$a_extraInitializers), __runInitializers(this, _$b_initializers, void 0));
|
|
340
|
-
constructor() {
|
|
341
|
-
__runInitializers(this, _$b_extraInitializers);
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
})();
|
|
345
|
-
// Both injected at decoration time
|
|
346
|
-
expect(document.head.querySelectorAll("style[data-praxis-hash]").length).toBe(2);
|
|
347
|
-
const inst = new Comp();
|
|
348
|
-
inst.onMount?.();
|
|
349
|
-
expect(document.head.querySelectorAll("style[data-praxis-hash]").length).toBe(2);
|
|
350
|
-
inst.onUnmount?.();
|
|
351
|
-
expect(document.head.querySelectorAll("style[data-praxis-hash]").length).toBe(2);
|
|
352
|
-
});
|
|
353
|
-
it("works with @Component() in the class stack", () => {
|
|
354
|
-
let Card = (() => {
|
|
355
|
-
let _classDecorators = [Component()];
|
|
356
|
-
let _classDescriptor;
|
|
357
|
-
let _classExtraInitializers = [];
|
|
358
|
-
let _classThis;
|
|
359
|
-
let _classSuper = StatefulComponent;
|
|
360
|
-
let _$btn_decorators;
|
|
361
|
-
let _$btn_initializers = [];
|
|
362
|
-
let _$btn_extraInitializers = [];
|
|
363
|
-
var Card = class extends _classSuper {
|
|
364
|
-
static { _classThis = this; }
|
|
365
|
-
static {
|
|
366
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
367
|
-
_$btn_decorators = [Styled(BtnStyle)];
|
|
368
|
-
__esDecorate(null, null, _$btn_decorators, { kind: "field", name: "$btn", static: false, private: false, access: { has: obj => "$btn" in obj, get: obj => obj.$btn, set: (obj, value) => { obj.$btn = value; } }, metadata: _metadata }, _$btn_initializers, _$btn_extraInitializers);
|
|
369
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
370
|
-
Card = _classThis = _classDescriptor.value;
|
|
371
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
372
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
373
|
-
}
|
|
374
|
-
$btn = __runInitializers(this, _$btn_initializers, void 0);
|
|
375
|
-
render() { return document.createElement("div"); }
|
|
376
|
-
constructor() {
|
|
377
|
-
super(...arguments);
|
|
378
|
-
__runInitializers(this, _$btn_extraInitializers);
|
|
379
|
-
}
|
|
380
|
-
};
|
|
381
|
-
return Card = _classThis;
|
|
382
|
-
})();
|
|
383
|
-
const inst = new Card();
|
|
384
|
-
expect(inst.$btn.$base).toMatch(/^prx-base-/);
|
|
385
|
-
});
|
|
386
|
-
it("skips $-prefixed fields that are neither string nor CSSBuilder", () => {
|
|
387
|
-
class S extends Stylesheet {
|
|
388
|
-
$root = 42;
|
|
389
|
-
$base = `display: flex;`;
|
|
390
|
-
}
|
|
391
|
-
let Comp = (() => {
|
|
392
|
-
let _$s_decorators;
|
|
393
|
-
let _$s_initializers = [];
|
|
394
|
-
let _$s_extraInitializers = [];
|
|
395
|
-
return class Comp {
|
|
396
|
-
static {
|
|
397
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
398
|
-
_$s_decorators = [Styled(S)];
|
|
399
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
400
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
401
|
-
}
|
|
402
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
403
|
-
constructor() {
|
|
404
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
405
|
-
}
|
|
406
|
-
};
|
|
407
|
-
})();
|
|
408
|
-
const inst = new Comp();
|
|
409
|
-
expect(inst.$s.$root).toBeUndefined();
|
|
410
|
-
expect(inst.$s.$base).toMatch(/^prx-base-/);
|
|
411
|
-
});
|
|
412
|
-
it("processes CSSBuilder fields (this.css({}))", () => {
|
|
413
|
-
class S extends Stylesheet {
|
|
414
|
-
$root = this.css({ display: "flex", gap: "12px" })
|
|
415
|
-
.hover({ opacity: 0.9 });
|
|
416
|
-
}
|
|
417
|
-
let Comp = (() => {
|
|
418
|
-
let _$s_decorators;
|
|
419
|
-
let _$s_initializers = [];
|
|
420
|
-
let _$s_extraInitializers = [];
|
|
421
|
-
return class Comp {
|
|
422
|
-
static {
|
|
423
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
424
|
-
_$s_decorators = [Styled(S)];
|
|
425
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
426
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
427
|
-
}
|
|
428
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
429
|
-
constructor() {
|
|
430
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
431
|
-
}
|
|
432
|
-
};
|
|
433
|
-
})();
|
|
434
|
-
const inst = new Comp();
|
|
435
|
-
expect(inst.$s.$root).toMatch(/^prx-root-/);
|
|
436
|
-
const css = document.head.querySelector("style[data-praxis-hash]")?.textContent ?? "";
|
|
437
|
-
expect(css).toContain("display: flex;");
|
|
438
|
-
expect(css).toContain("&:hover");
|
|
439
|
-
inst.onUnmount?.();
|
|
440
|
-
});
|
|
441
|
-
});
|
|
442
|
-
// ─── @Param() reactive CSS vars ─────────────────────────────────────────────────
|
|
443
|
-
function makeAnchor(parent) {
|
|
444
|
-
const anchor = document.createComment("[/Comp]");
|
|
445
|
-
parent.appendChild(anchor);
|
|
446
|
-
return anchor;
|
|
447
|
-
}
|
|
448
|
-
describe("@Param — reactive CSS custom properties", () => {
|
|
449
|
-
it("@Param() field exposes a getter/setter on the stylesheet object", () => {
|
|
450
|
-
let S = (() => {
|
|
451
|
-
let _classSuper = ReactiveStylesheet;
|
|
452
|
-
let _color_decorators;
|
|
453
|
-
let _color_initializers = [];
|
|
454
|
-
let _color_extraInitializers = [];
|
|
455
|
-
return class S extends _classSuper {
|
|
456
|
-
static {
|
|
457
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
458
|
-
_color_decorators = [Param()];
|
|
459
|
-
__esDecorate(null, null, _color_decorators, { kind: "field", name: "color", static: false, private: false, access: { has: obj => "color" in obj, get: obj => obj.color, set: (obj, value) => { obj.color = value; } }, metadata: _metadata }, _color_initializers, _color_extraInitializers);
|
|
460
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
461
|
-
}
|
|
462
|
-
color = __runInitializers(this, _color_initializers, "#3b82f6");
|
|
463
|
-
$root = (__runInitializers(this, _color_extraInitializers), `background: var(--color);`);
|
|
464
|
-
};
|
|
465
|
-
})();
|
|
466
|
-
let Comp = (() => {
|
|
467
|
-
let _classSuper = StatefulComponent;
|
|
468
|
-
let _$s_decorators;
|
|
469
|
-
let _$s_initializers = [];
|
|
470
|
-
let _$s_extraInitializers = [];
|
|
471
|
-
return class Comp extends _classSuper {
|
|
472
|
-
static {
|
|
473
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
474
|
-
_$s_decorators = [Styled(S)];
|
|
475
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
476
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
477
|
-
}
|
|
478
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
479
|
-
render() { return document.createElement("div"); }
|
|
480
|
-
constructor() {
|
|
481
|
-
super(...arguments);
|
|
482
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
483
|
-
}
|
|
484
|
-
};
|
|
485
|
-
})();
|
|
486
|
-
const inst = new Comp();
|
|
487
|
-
expect(inst.$s.color).toBe("#3b82f6");
|
|
488
|
-
inst.$s.color = "red";
|
|
489
|
-
expect(inst.$s.color).toBe("red");
|
|
490
|
-
});
|
|
491
|
-
it("sets the CSS var on the element when onMount fires", () => {
|
|
492
|
-
const container = document.createElement("div");
|
|
493
|
-
document.body.appendChild(container);
|
|
494
|
-
let S = (() => {
|
|
495
|
-
let _classSuper = ReactiveStylesheet;
|
|
496
|
-
let _accent_decorators;
|
|
497
|
-
let _accent_initializers = [];
|
|
498
|
-
let _accent_extraInitializers = [];
|
|
499
|
-
return class S extends _classSuper {
|
|
500
|
-
static {
|
|
501
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
502
|
-
_accent_decorators = [Param()];
|
|
503
|
-
__esDecorate(null, null, _accent_decorators, { kind: "field", name: "accent", static: false, private: false, access: { has: obj => "accent" in obj, get: obj => obj.accent, set: (obj, value) => { obj.accent = value; } }, metadata: _metadata }, _accent_initializers, _accent_extraInitializers);
|
|
504
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
505
|
-
}
|
|
506
|
-
accent = __runInitializers(this, _accent_initializers, "#3b82f6");
|
|
507
|
-
$root = (__runInitializers(this, _accent_extraInitializers), `color: var(--accent);`);
|
|
508
|
-
};
|
|
509
|
-
})();
|
|
510
|
-
let Comp = (() => {
|
|
511
|
-
let _classSuper = StatefulComponent;
|
|
512
|
-
let _$s_decorators;
|
|
513
|
-
let _$s_initializers = [];
|
|
514
|
-
let _$s_extraInitializers = [];
|
|
515
|
-
return class Comp extends _classSuper {
|
|
516
|
-
static {
|
|
517
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
518
|
-
_$s_decorators = [Styled(S)];
|
|
519
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
520
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
521
|
-
}
|
|
522
|
-
constructor() {
|
|
523
|
-
super();
|
|
524
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
525
|
-
setComponentAnchor(this, makeAnchor(container));
|
|
526
|
-
}
|
|
527
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
528
|
-
render() { return document.createElement("div"); }
|
|
529
|
-
};
|
|
530
|
-
})();
|
|
531
|
-
const inst = new Comp();
|
|
532
|
-
inst.onMount?.();
|
|
533
|
-
expect(container.style.getPropertyValue("--accent")).toBe("#3b82f6");
|
|
534
|
-
container.remove();
|
|
535
|
-
});
|
|
536
|
-
it("updates the CSS var reactively when the field is set", () => {
|
|
537
|
-
const container = document.createElement("div");
|
|
538
|
-
document.body.appendChild(container);
|
|
539
|
-
let S = (() => {
|
|
540
|
-
let _classSuper = ReactiveStylesheet;
|
|
541
|
-
let _color_decorators;
|
|
542
|
-
let _color_initializers = [];
|
|
543
|
-
let _color_extraInitializers = [];
|
|
544
|
-
return class S extends _classSuper {
|
|
545
|
-
static {
|
|
546
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
547
|
-
_color_decorators = [Param()];
|
|
548
|
-
__esDecorate(null, null, _color_decorators, { kind: "field", name: "color", static: false, private: false, access: { has: obj => "color" in obj, get: obj => obj.color, set: (obj, value) => { obj.color = value; } }, metadata: _metadata }, _color_initializers, _color_extraInitializers);
|
|
549
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
550
|
-
}
|
|
551
|
-
color = __runInitializers(this, _color_initializers, "blue");
|
|
552
|
-
$root = (__runInitializers(this, _color_extraInitializers), `color: var(--color);`);
|
|
553
|
-
};
|
|
554
|
-
})();
|
|
555
|
-
let Comp = (() => {
|
|
556
|
-
let _classSuper = StatefulComponent;
|
|
557
|
-
let _$s_decorators;
|
|
558
|
-
let _$s_initializers = [];
|
|
559
|
-
let _$s_extraInitializers = [];
|
|
560
|
-
return class Comp extends _classSuper {
|
|
561
|
-
static {
|
|
562
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
563
|
-
_$s_decorators = [Styled(S)];
|
|
564
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
565
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
566
|
-
}
|
|
567
|
-
constructor() {
|
|
568
|
-
super();
|
|
569
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
570
|
-
setComponentAnchor(this, makeAnchor(container));
|
|
571
|
-
}
|
|
572
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
573
|
-
render() { return document.createElement("div"); }
|
|
574
|
-
};
|
|
575
|
-
})();
|
|
576
|
-
const inst = new Comp();
|
|
577
|
-
inst.onMount?.();
|
|
578
|
-
expect(container.style.getPropertyValue("--color")).toBe("blue");
|
|
579
|
-
inst.$s.color = "red";
|
|
580
|
-
expect(container.style.getPropertyValue("--color")).toBe("red");
|
|
581
|
-
container.remove();
|
|
582
|
-
});
|
|
583
|
-
it("removes CSS vars on onUnmount", () => {
|
|
584
|
-
const container = document.createElement("div");
|
|
585
|
-
document.body.appendChild(container);
|
|
586
|
-
let S = (() => {
|
|
587
|
-
let _classSuper = ReactiveStylesheet;
|
|
588
|
-
let _size_decorators;
|
|
589
|
-
let _size_initializers = [];
|
|
590
|
-
let _size_extraInitializers = [];
|
|
591
|
-
return class S extends _classSuper {
|
|
592
|
-
static {
|
|
593
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
594
|
-
_size_decorators = [Param()];
|
|
595
|
-
__esDecorate(null, null, _size_decorators, { kind: "field", name: "size", static: false, private: false, access: { has: obj => "size" in obj, get: obj => obj.size, set: (obj, value) => { obj.size = value; } }, metadata: _metadata }, _size_initializers, _size_extraInitializers);
|
|
596
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
597
|
-
}
|
|
598
|
-
size = __runInitializers(this, _size_initializers, "16px");
|
|
599
|
-
$root = (__runInitializers(this, _size_extraInitializers), `font-size: var(--size);`);
|
|
600
|
-
};
|
|
601
|
-
})();
|
|
602
|
-
let Comp = (() => {
|
|
603
|
-
let _classSuper = StatefulComponent;
|
|
604
|
-
let _$s_decorators;
|
|
605
|
-
let _$s_initializers = [];
|
|
606
|
-
let _$s_extraInitializers = [];
|
|
607
|
-
return class Comp extends _classSuper {
|
|
608
|
-
static {
|
|
609
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
610
|
-
_$s_decorators = [Styled(S)];
|
|
611
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
612
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
613
|
-
}
|
|
614
|
-
constructor() {
|
|
615
|
-
super();
|
|
616
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
617
|
-
setComponentAnchor(this, makeAnchor(container));
|
|
618
|
-
}
|
|
619
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
620
|
-
render() { return document.createElement("div"); }
|
|
621
|
-
};
|
|
622
|
-
})();
|
|
623
|
-
const inst = new Comp();
|
|
624
|
-
inst.onMount?.();
|
|
625
|
-
expect(container.style.getPropertyValue("--size")).toBe("16px");
|
|
626
|
-
inst.onUnmount?.();
|
|
627
|
-
expect(container.style.getPropertyValue("--size")).toBe("");
|
|
628
|
-
container.remove();
|
|
629
|
-
});
|
|
630
|
-
it("each instance gets independent signal state", () => {
|
|
631
|
-
const c1 = document.createElement("div");
|
|
632
|
-
const c2 = document.createElement("div");
|
|
633
|
-
document.body.append(c1, c2);
|
|
634
|
-
let S = (() => {
|
|
635
|
-
let _classSuper = ReactiveStylesheet;
|
|
636
|
-
let _color_decorators;
|
|
637
|
-
let _color_initializers = [];
|
|
638
|
-
let _color_extraInitializers = [];
|
|
639
|
-
return class S extends _classSuper {
|
|
640
|
-
static {
|
|
641
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
642
|
-
_color_decorators = [Param()];
|
|
643
|
-
__esDecorate(null, null, _color_decorators, { kind: "field", name: "color", static: false, private: false, access: { has: obj => "color" in obj, get: obj => obj.color, set: (obj, value) => { obj.color = value; } }, metadata: _metadata }, _color_initializers, _color_extraInitializers);
|
|
644
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
645
|
-
}
|
|
646
|
-
color = __runInitializers(this, _color_initializers, "blue");
|
|
647
|
-
$root = (__runInitializers(this, _color_extraInitializers), `color: var(--color);`);
|
|
648
|
-
};
|
|
649
|
-
})();
|
|
650
|
-
let Comp = (() => {
|
|
651
|
-
let _classSuper = StatefulComponent;
|
|
652
|
-
let _$s_decorators;
|
|
653
|
-
let _$s_initializers = [];
|
|
654
|
-
let _$s_extraInitializers = [];
|
|
655
|
-
return class Comp extends _classSuper {
|
|
656
|
-
static {
|
|
657
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
658
|
-
_$s_decorators = [Styled(S)];
|
|
659
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
660
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
661
|
-
}
|
|
662
|
-
constructor(anchor) {
|
|
663
|
-
super();
|
|
664
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
665
|
-
setComponentAnchor(this, anchor);
|
|
666
|
-
}
|
|
667
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
668
|
-
render() { return document.createElement("div"); }
|
|
669
|
-
};
|
|
670
|
-
})();
|
|
671
|
-
const i1 = new Comp(makeAnchor(c1));
|
|
672
|
-
const i2 = new Comp(makeAnchor(c2));
|
|
673
|
-
i1.onMount?.();
|
|
674
|
-
i2.onMount?.();
|
|
675
|
-
i1.$s.color = "red";
|
|
676
|
-
expect(c1.style.getPropertyValue("--color")).toBe("red");
|
|
677
|
-
expect(c2.style.getPropertyValue("--color")).toBe("blue");
|
|
678
|
-
c1.remove();
|
|
679
|
-
c2.remove();
|
|
680
|
-
});
|
|
681
|
-
it("Stylesheet with only @Param() fields (no $ CSS) — no style element injected", () => {
|
|
682
|
-
let S = (() => {
|
|
683
|
-
let _classSuper = ReactiveStylesheet;
|
|
684
|
-
let _color_decorators;
|
|
685
|
-
let _color_initializers = [];
|
|
686
|
-
let _color_extraInitializers = [];
|
|
687
|
-
return class S extends _classSuper {
|
|
688
|
-
static {
|
|
689
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
690
|
-
_color_decorators = [Param()];
|
|
691
|
-
__esDecorate(null, null, _color_decorators, { kind: "field", name: "color", static: false, private: false, access: { has: obj => "color" in obj, get: obj => obj.color, set: (obj, value) => { obj.color = value; } }, metadata: _metadata }, _color_initializers, _color_extraInitializers);
|
|
692
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
693
|
-
}
|
|
694
|
-
color = __runInitializers(this, _color_initializers, "red");
|
|
695
|
-
constructor() {
|
|
696
|
-
super(...arguments);
|
|
697
|
-
__runInitializers(this, _color_extraInitializers);
|
|
698
|
-
}
|
|
699
|
-
};
|
|
700
|
-
})();
|
|
701
|
-
let Comp = (() => {
|
|
702
|
-
let _classSuper = StatefulComponent;
|
|
703
|
-
let _$s_decorators;
|
|
704
|
-
let _$s_initializers = [];
|
|
705
|
-
let _$s_extraInitializers = [];
|
|
706
|
-
return class Comp extends _classSuper {
|
|
707
|
-
static {
|
|
708
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
709
|
-
_$s_decorators = [Styled(S)];
|
|
710
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
711
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
712
|
-
}
|
|
713
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
714
|
-
render() { return document.createElement("div"); }
|
|
715
|
-
constructor() {
|
|
716
|
-
super(...arguments);
|
|
717
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
})();
|
|
721
|
-
const inst = new Comp();
|
|
722
|
-
inst.onMount?.();
|
|
723
|
-
expect(document.head.querySelector("style[data-praxis-hash]")).toBeNull();
|
|
724
|
-
inst.onUnmount?.();
|
|
725
|
-
});
|
|
726
|
-
it("@Param() field with non-string/non-number value is skipped (defensive)", () => {
|
|
727
|
-
let S = (() => {
|
|
728
|
-
let _classSuper = ReactiveStylesheet;
|
|
729
|
-
let _items_decorators;
|
|
730
|
-
let _items_initializers = [];
|
|
731
|
-
let _items_extraInitializers = [];
|
|
732
|
-
return class S extends _classSuper {
|
|
733
|
-
static {
|
|
734
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
735
|
-
_items_decorators = [Param()];
|
|
736
|
-
__esDecorate(null, null, _items_decorators, { kind: "field", name: "items", static: false, private: false, access: { has: obj => "items" in obj, get: obj => obj.items, set: (obj, value) => { obj.items = value; } }, metadata: _metadata }, _items_initializers, _items_extraInitializers);
|
|
737
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
738
|
-
}
|
|
739
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
740
|
-
items = __runInitializers(this, _items_initializers, []);
|
|
741
|
-
$root = (__runInitializers(this, _items_extraInitializers), `display: flex;`);
|
|
742
|
-
};
|
|
743
|
-
})();
|
|
744
|
-
let Comp = (() => {
|
|
745
|
-
let _classSuper = StatefulComponent;
|
|
746
|
-
let _$s_decorators;
|
|
747
|
-
let _$s_initializers = [];
|
|
748
|
-
let _$s_extraInitializers = [];
|
|
749
|
-
return class Comp extends _classSuper {
|
|
750
|
-
static {
|
|
751
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
752
|
-
_$s_decorators = [Styled(S)];
|
|
753
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
754
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
755
|
-
}
|
|
756
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
757
|
-
render() { return document.createElement("div"); }
|
|
758
|
-
constructor() {
|
|
759
|
-
super(...arguments);
|
|
760
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
})();
|
|
764
|
-
const inst = new Comp();
|
|
765
|
-
expect(inst.$s.$root).toMatch(/^prx-root-/);
|
|
766
|
-
expect(inst.$s.items).toBeUndefined();
|
|
767
|
-
});
|
|
768
|
-
it("non-$ non-@Param() fields in Stylesheet are silently ignored", () => {
|
|
769
|
-
class S extends ReactiveStylesheet {
|
|
770
|
-
$root = `display: flex;`;
|
|
771
|
-
description = "a plain field that should be skipped";
|
|
772
|
-
}
|
|
773
|
-
let Comp = (() => {
|
|
774
|
-
let _classSuper = StatefulComponent;
|
|
775
|
-
let _$s_decorators;
|
|
776
|
-
let _$s_initializers = [];
|
|
777
|
-
let _$s_extraInitializers = [];
|
|
778
|
-
return class Comp extends _classSuper {
|
|
779
|
-
static {
|
|
780
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
781
|
-
_$s_decorators = [Styled(S)];
|
|
782
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
783
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
784
|
-
}
|
|
785
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
786
|
-
render() { return document.createElement("div"); }
|
|
787
|
-
constructor() {
|
|
788
|
-
super(...arguments);
|
|
789
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
790
|
-
}
|
|
791
|
-
};
|
|
792
|
-
})();
|
|
793
|
-
const inst = new Comp();
|
|
794
|
-
expect(inst.$s.$root).toMatch(/^prx-root-/);
|
|
795
|
-
expect(inst.$s.description).toBeUndefined();
|
|
796
|
-
});
|
|
797
|
-
it("two @Param() fields on the same class — PARAM_META entry reused", () => {
|
|
798
|
-
let S = (() => {
|
|
799
|
-
let _classSuper = ReactiveStylesheet;
|
|
800
|
-
let _color_decorators;
|
|
801
|
-
let _color_initializers = [];
|
|
802
|
-
let _color_extraInitializers = [];
|
|
803
|
-
let _radius_decorators;
|
|
804
|
-
let _radius_initializers = [];
|
|
805
|
-
let _radius_extraInitializers = [];
|
|
806
|
-
return class S extends _classSuper {
|
|
807
|
-
static {
|
|
808
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
809
|
-
_color_decorators = [Param()];
|
|
810
|
-
_radius_decorators = [Param()];
|
|
811
|
-
__esDecorate(null, null, _color_decorators, { kind: "field", name: "color", static: false, private: false, access: { has: obj => "color" in obj, get: obj => obj.color, set: (obj, value) => { obj.color = value; } }, metadata: _metadata }, _color_initializers, _color_extraInitializers);
|
|
812
|
-
__esDecorate(null, null, _radius_decorators, { kind: "field", name: "radius", static: false, private: false, access: { has: obj => "radius" in obj, get: obj => obj.radius, set: (obj, value) => { obj.radius = value; } }, metadata: _metadata }, _radius_initializers, _radius_extraInitializers);
|
|
813
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
814
|
-
}
|
|
815
|
-
color = __runInitializers(this, _color_initializers, "blue");
|
|
816
|
-
radius = (__runInitializers(this, _color_extraInitializers), __runInitializers(this, _radius_initializers, "8px"));
|
|
817
|
-
$root = (__runInitializers(this, _radius_extraInitializers), `color: var(--color); border-radius: var(--radius);`);
|
|
818
|
-
};
|
|
819
|
-
})();
|
|
820
|
-
let Comp = (() => {
|
|
821
|
-
let _classSuper = StatefulComponent;
|
|
822
|
-
let _$s_decorators;
|
|
823
|
-
let _$s_initializers = [];
|
|
824
|
-
let _$s_extraInitializers = [];
|
|
825
|
-
return class Comp extends _classSuper {
|
|
826
|
-
static {
|
|
827
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
828
|
-
_$s_decorators = [Styled(S)];
|
|
829
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
830
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
831
|
-
}
|
|
832
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
833
|
-
render() { return document.createElement("div"); }
|
|
834
|
-
constructor() {
|
|
835
|
-
super(...arguments);
|
|
836
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
837
|
-
}
|
|
838
|
-
};
|
|
839
|
-
})();
|
|
840
|
-
const inst = new Comp();
|
|
841
|
-
expect(inst.$s.color).toBe("blue");
|
|
842
|
-
expect(inst.$s.radius).toBe("8px");
|
|
843
|
-
});
|
|
844
|
-
it("onUnmount removes CSS vars from element when el is present", () => {
|
|
845
|
-
const container = document.createElement("div");
|
|
846
|
-
document.body.appendChild(container);
|
|
847
|
-
let S = (() => {
|
|
848
|
-
let _classSuper = ReactiveStylesheet;
|
|
849
|
-
let _color_decorators;
|
|
850
|
-
let _color_initializers = [];
|
|
851
|
-
let _color_extraInitializers = [];
|
|
852
|
-
return class S extends _classSuper {
|
|
853
|
-
static {
|
|
854
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
855
|
-
_color_decorators = [Param()];
|
|
856
|
-
__esDecorate(null, null, _color_decorators, { kind: "field", name: "color", static: false, private: false, access: { has: obj => "color" in obj, get: obj => obj.color, set: (obj, value) => { obj.color = value; } }, metadata: _metadata }, _color_initializers, _color_extraInitializers);
|
|
857
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
858
|
-
}
|
|
859
|
-
color = __runInitializers(this, _color_initializers, "red");
|
|
860
|
-
$root = (__runInitializers(this, _color_extraInitializers), `color: var(--color);`);
|
|
861
|
-
};
|
|
862
|
-
})();
|
|
863
|
-
let Comp = (() => {
|
|
864
|
-
let _classSuper = StatefulComponent;
|
|
865
|
-
let _$s_decorators;
|
|
866
|
-
let _$s_initializers = [];
|
|
867
|
-
let _$s_extraInitializers = [];
|
|
868
|
-
return class Comp extends _classSuper {
|
|
869
|
-
static {
|
|
870
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
871
|
-
_$s_decorators = [Styled(S)];
|
|
872
|
-
__esDecorate(null, null, _$s_decorators, { kind: "field", name: "$s", static: false, private: false, access: { has: obj => "$s" in obj, get: obj => obj.$s, set: (obj, value) => { obj.$s = value; } }, metadata: _metadata }, _$s_initializers, _$s_extraInitializers);
|
|
873
|
-
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
874
|
-
}
|
|
875
|
-
constructor() {
|
|
876
|
-
super();
|
|
877
|
-
__runInitializers(this, _$s_extraInitializers);
|
|
878
|
-
setComponentAnchor(this, makeAnchor(container));
|
|
879
|
-
}
|
|
880
|
-
$s = __runInitializers(this, _$s_initializers, void 0);
|
|
881
|
-
render() { return document.createElement("div"); }
|
|
882
|
-
};
|
|
883
|
-
})();
|
|
884
|
-
const inst = new Comp();
|
|
885
|
-
inst.onMount?.();
|
|
886
|
-
expect(container.style.getPropertyValue("--color")).toBe("red");
|
|
887
|
-
inst.onUnmount?.();
|
|
888
|
-
expect(container.style.getPropertyValue("--color")).toBe("");
|
|
889
|
-
container.remove();
|
|
890
|
-
});
|
|
891
|
-
it("@Param() cannot be applied outside ReactiveStylesheet — enforced at TypeScript level", () => {
|
|
892
|
-
expect(() => {
|
|
893
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
894
|
-
const dec = Param;
|
|
895
|
-
const fakeCtx = {
|
|
896
|
-
name: "foo",
|
|
897
|
-
addInitializer(fn) { fn.call({ constructor: class {
|
|
898
|
-
} }); },
|
|
899
|
-
};
|
|
900
|
-
dec(undefined, fakeCtx);
|
|
901
|
-
}).not.toThrow();
|
|
902
|
-
});
|
|
903
|
-
});
|
|
904
|
-
//# sourceMappingURL=styled.test.js.map
|