@roots/bud-client 6.10.0 → 6.11.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/hot/client.d.ts +6 -0
- package/lib/hot/client.d.ts.map +1 -0
- package/lib/hot/client.js +143 -0
- package/lib/hot/components/index.d.ts +2 -0
- package/lib/hot/components/index.d.ts.map +1 -0
- package/lib/hot/components/index.js +32 -0
- package/lib/hot/components/indicator/index.d.ts +4 -0
- package/lib/hot/components/indicator/index.d.ts.map +1 -0
- package/lib/hot/components/indicator/index.js +17 -0
- package/lib/hot/components/indicator/indicator.component.d.ts +84 -0
- package/lib/hot/components/indicator/indicator.component.d.ts.map +1 -0
- package/lib/hot/components/indicator/indicator.component.js +175 -0
- package/lib/hot/components/indicator/indicator.controller.d.ts +45 -0
- package/lib/hot/components/indicator/indicator.controller.d.ts.map +1 -0
- package/lib/hot/components/indicator/indicator.controller.js +54 -0
- package/lib/hot/components/indicator/indicator.pulse.d.ts +9 -0
- package/lib/hot/components/indicator/indicator.pulse.d.ts.map +1 -0
- package/lib/hot/components/indicator/indicator.pulse.js +36 -0
- package/lib/hot/components/overlay/index.d.ts +4 -0
- package/lib/hot/components/overlay/index.d.ts.map +1 -0
- package/lib/hot/components/overlay/index.js +17 -0
- package/lib/hot/components/overlay/overlay.component.d.ts +20 -0
- package/lib/hot/components/overlay/overlay.component.d.ts.map +1 -0
- package/lib/hot/components/overlay/overlay.component.js +146 -0
- package/lib/hot/components/overlay/overlay.controller.d.ts +46 -0
- package/lib/hot/components/overlay/overlay.controller.d.ts.map +1 -0
- package/lib/hot/components/overlay/overlay.controller.js +70 -0
- package/lib/hot/events.d.ts +98 -0
- package/lib/hot/events.d.ts.map +1 -0
- package/lib/hot/events.js +89 -0
- package/lib/hot/index.cjs +5 -0
- package/lib/hot/index.d.cts +2 -0
- package/lib/hot/index.d.cts.map +1 -0
- package/lib/hot/index.d.mts +2 -0
- package/lib/hot/index.d.mts.map +1 -0
- package/lib/hot/index.mjs +17 -0
- package/lib/hot/log.d.ts +11 -0
- package/lib/hot/log.d.ts.map +1 -0
- package/lib/hot/log.js +37 -0
- package/lib/hot/options.d.ts +17 -0
- package/lib/hot/options.d.ts.map +1 -0
- package/lib/hot/options.js +33 -0
- package/lib/index.cjs +3 -0
- package/lib/index.d.cts +13 -0
- package/lib/index.d.cts.map +1 -0
- package/lib/index.d.mts +13 -0
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +3 -0
- package/lib/intercept/index.d.ts +3 -0
- package/lib/intercept/index.d.ts.map +1 -0
- package/lib/intercept/index.js +18 -0
- package/lib/intercept/proxy-click-interceptor.d.ts +2 -0
- package/lib/intercept/proxy-click-interceptor.d.ts.map +1 -0
- package/lib/intercept/proxy-click-interceptor.js +26 -0
- package/package.json +2 -2
package/lib/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/intercept/index.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,SAAS,0CA2Bd,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const intercept = (...args) => {
|
|
2
|
+
args.every(arg => typeof arg === `string`) &&
|
|
3
|
+
setInterval(() => [
|
|
4
|
+
[document.getElementsByTagName(`a`), `href`],
|
|
5
|
+
[document.getElementsByTagName(`link`), `href`],
|
|
6
|
+
]
|
|
7
|
+
.map(([elements, attribute]) => [Array.from(elements), attribute])
|
|
8
|
+
.forEach(([elements, attribute]) => elements
|
|
9
|
+
.filter(el => el.hasAttribute(attribute))
|
|
10
|
+
.filter(el => !el.hasAttribute(`__bud_processed`))
|
|
11
|
+
.filter(el => el.getAttribute(attribute).startsWith(args[0]))
|
|
12
|
+
.map(el => {
|
|
13
|
+
const value = el.getAttribute(attribute).replace(...args);
|
|
14
|
+
el.setAttribute(attribute, value);
|
|
15
|
+
el.toggleAttribute(`__bud_processed`);
|
|
16
|
+
})), 1000);
|
|
17
|
+
};
|
|
18
|
+
export default intercept;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-click-interceptor.d.ts","sourceRoot":"","sources":["../../src/intercept/proxy-click-interceptor.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
/* global __resourceQuery */
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
import intercept from './index.js';
|
|
13
|
+
window.requestAnimationFrame(function ready() {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
if (!__resourceQuery)
|
|
16
|
+
return;
|
|
17
|
+
const params = new URLSearchParams(__resourceQuery);
|
|
18
|
+
if (!params || !params.has(`search`) || !params.has(`replace`))
|
|
19
|
+
return;
|
|
20
|
+
const search = decodeURI(params.get(`search`));
|
|
21
|
+
const replace = decodeURI(params.get(`replace`));
|
|
22
|
+
return document.body
|
|
23
|
+
? intercept(search, replace)
|
|
24
|
+
: window.requestAnimationFrame(ready);
|
|
25
|
+
});
|
|
26
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roots/bud-client",
|
|
3
3
|
"description": "Client scripts for @roots/bud",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.11.0",
|
|
5
5
|
"homepage": "https://roots.io/bud",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@roots/bud": "6.
|
|
59
|
+
"@roots/bud": "6.11.0",
|
|
60
60
|
"@skypack/package-check": "0.2.2",
|
|
61
61
|
"@types/node": "18.11.18",
|
|
62
62
|
"@types/webpack-env": "1.18.0"
|