@klarkxy/dsh-context-cleaner 0.1.0 → 0.1.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/client.js +21 -1
- package/package.json +2 -2
package/client.js
CHANGED
|
@@ -15,6 +15,22 @@
|
|
|
15
15
|
window.__ModuleLoader__.load({
|
|
16
16
|
id: '@klarkxy/dsh-context-cleaner',
|
|
17
17
|
factory() {
|
|
18
|
+
function recordClientLog(level, event, message) {
|
|
19
|
+
try {
|
|
20
|
+
const g = typeof globalThis !== 'undefined' ? globalThis : window;
|
|
21
|
+
const list = Array.isArray(g.__KLARKXY_PLUGIN_LOGS__) ? g.__KLARKXY_PLUGIN_LOGS__ : (g.__KLARKXY_PLUGIN_LOGS__ = []);
|
|
22
|
+
list.push({
|
|
23
|
+
version: 1,
|
|
24
|
+
at: new Date().toISOString(),
|
|
25
|
+
level,
|
|
26
|
+
source: 'dsh-context-cleaner',
|
|
27
|
+
surface: 'client',
|
|
28
|
+
event,
|
|
29
|
+
message,
|
|
30
|
+
});
|
|
31
|
+
if (list.length > 300) list.splice(0, list.length - 300);
|
|
32
|
+
} catch {}
|
|
33
|
+
}
|
|
18
34
|
return {
|
|
19
35
|
apply(ctx) {
|
|
20
36
|
ctx.effect(() => {
|
|
@@ -31,7 +47,11 @@ window.__ModuleLoader__.load({
|
|
|
31
47
|
tag.textContent =
|
|
32
48
|
'.lc-root > .lc-cols.lc-head > .lc-col:has(.lc-pi-grid, .lc-recom) { display: none; }';
|
|
33
49
|
document.head.appendChild(tag);
|
|
34
|
-
|
|
50
|
+
recordClientLog('info', 'client.loaded', 'Installed dsh-context-cleaner stylesheet.');
|
|
51
|
+
return () => {
|
|
52
|
+
tag.remove();
|
|
53
|
+
recordClientLog('debug', 'client.disposed', 'Removed dsh-context-cleaner stylesheet.');
|
|
54
|
+
};
|
|
35
55
|
}, 'dsh-context-cleaner: hide cards');
|
|
36
56
|
},
|
|
37
57
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@klarkxy/dsh-context-cleaner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Hide the plugin-info and promotion cards at the top of the dsh-context dashboard.",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -66,6 +66,6 @@
|
|
|
66
66
|
"registry": "https://registry.npmjs.org/"
|
|
67
67
|
},
|
|
68
68
|
"dshRelease": {
|
|
69
|
-
"contentHash": "
|
|
69
|
+
"contentHash": "13c5e67f9b0bec7127312a32a66c7f96d5f347072c4d52b69e67f920edace6a7"
|
|
70
70
|
}
|
|
71
71
|
}
|