@agrotools1/at-mf-utils 0.4.0 → 0.4.1-alpha.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agrotools1/at-mf-utils",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.4.1-alpha.0",
5
5
  "private": false,
6
6
  "description": "Métodos utilitários de MF da Agrotools",
7
7
  "author": "Agrotools",
@@ -20,4 +20,4 @@
20
20
  "publishConfig": {
21
21
  "access": "public"
22
22
  }
23
- }
23
+ }
@@ -1,18 +0,0 @@
1
- type IResponse = {
2
- mount: (tag: string, props?: Record<string, any>) => void;
3
- unmount: () => void;
4
- asyncComponents: Record<string, any>;
5
- };
6
- /**
7
- * @param moduleId Valor da propriedade `name` do `package.json` do módulo
8
- * @param url URL do módulo
9
- * @param app Instância do Vue. Utilize para registrar componentes assíncronos.
10
- *
11
- * Cacheie o resultado dessa função para evitar múltiplas requisições.
12
- *
13
- * Chame o método `unmount` para remover todo o script e CSS injetado.
14
- *
15
- * Ao chamar o método `unmount` será necessário renovar o cache dessa função.
16
- */
17
- export default function getModule(moduleId: string, url: string, app?: any): Promise<IResponse>;
18
- export {};
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import { default as getModule } from './build';
2
- export { getModule };
package/dist/index.js DELETED
@@ -1,48 +0,0 @@
1
- function m() {
2
- const t = document.querySelectorAll('link[from="athost"]');
3
- for (let n = 0; n < t.length; n++)
4
- t[n].remove();
5
- }
6
- function d(t, n) {
7
- const e = document.getElementById(t);
8
- window[n] = null, e == null || e.remove();
9
- }
10
- async function y(t, n) {
11
- if (!t || !n) return;
12
- const e = Object.entries(t);
13
- for (let s = 0; s < e.length; s++) {
14
- const [r, o] = e[s], c = await o();
15
- n.appContext.app.component(r, c.default);
16
- }
17
- }
18
- async function p(t, n) {
19
- return new Promise((e) => {
20
- m(), d(t, n), e();
21
- });
22
- }
23
- async function g(t, n, e) {
24
- const s = `remote-entry-${t}`;
25
- return await p(s, t), await (__webpack_init_sharing__ == null ? void 0 : __webpack_init_sharing__("default")), new Promise((r) => {
26
- const o = document.createElement("script");
27
- o.type = "text/javascript", o.src = n, o.defer = !0, o.async = !0, o.id = s, document.head.appendChild(o), o.onload = async () => {
28
- var _;
29
- const c = window[t], i = typeof __webpack_share_scopes__ < "u" ? __webpack_share_scopes__ : null;
30
- await (c == null ? void 0 : c.init(i == null ? void 0 : i.default));
31
- const u = await (await ((_ = c.get) == null ? void 0 : _.call(c, t)))().default, a = u == null ? void 0 : u.default;
32
- y(a.asyncComponents, e);
33
- const f = {
34
- ...a || {},
35
- defaultImport: a,
36
- unmount: async () => {
37
- a == null || a.unmount(), p(s, t);
38
- const l = document.getElementById("agrotools-app");
39
- l == null || l.remove();
40
- }
41
- };
42
- r(f);
43
- };
44
- });
45
- }
46
- export {
47
- g as getModule
48
- };