@useinsider/guido 1.0.0-beta.6ebce36 → 1.0.0-beta.6ecc044
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/README.md +1 -191
- package/dist/@types/generic.d.ts +0 -3
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +26 -22
- package/dist/components/organisms/base/ModalWrapper.vue.d.ts +72 -0
- package/dist/components/organisms/base/ModalWrapper.vue.js +19 -0
- package/dist/components/organisms/base/ModalWrapper.vue2.js +43 -0
- package/dist/components/organisms/header/LeftSlot.vue.d.ts +1 -1
- package/dist/components/organisms/header/LeftSlot.vue.js +8 -8
- package/dist/components/organisms/header/LeftSlot.vue2.js +3 -5
- package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
- package/dist/components/organisms/header/MiddleSlot.vue2.js +4 -6
- package/dist/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/components/organisms/header/RightSlot.vue.js +10 -7
- package/dist/components/organisms/header/RightSlot.vue2.js +19 -14
- package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +1 -13
- package/dist/components/organisms/header/version-history/VersionHistory.vue.js +7 -7
- package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +10 -13
- package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +20 -0
- package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +19 -0
- package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +66 -0
- package/dist/composables/useCustomInterfaceAppearance.js +9 -45
- package/dist/composables/useExport.d.ts +1 -1
- package/dist/composables/useExport.js +20 -35
- package/dist/composables/useStripo.js +8 -13
- package/dist/composables/useTemplateValidation.d.ts +13 -0
- package/dist/composables/useTemplateValidation.js +57 -0
- package/dist/guido.css +1 -1
- package/dist/mock/api/template-library.d.ts +2 -0
- package/dist/static/editor.css.js +232 -0
- package/dist/stores/editor.d.ts +1 -0
- package/dist/stores/editor.js +2 -1
- package/package.json +1 -1
- package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +0 -2
- package/dist/components/organisms/header/version-history/RestoreButton.vue.js +0 -19
- package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +0 -14
- package/dist/composables/useHtmlCompiler.d.ts +0 -4
- package/dist/composables/useHtmlCompiler.js +0 -16
- package/dist/config/compiler/htmlCompilerRules.d.ts +0 -2
- package/dist/config/compiler/htmlCompilerRules.js +0 -145
- package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
- package/dist/enums/displayConditions.d.ts +0 -2
- package/dist/enums/displayConditions.js +0 -80
- package/dist/static/styles/base.css.js +0 -11
- package/dist/static/styles/components/alert-message.css.js +0 -39
- package/dist/static/styles/components/amp-block.css.js +0 -18
- package/dist/static/styles/components/base-input.css.js +0 -47
- package/dist/static/styles/components/button-group.css.js +0 -54
- package/dist/static/styles/components/button.css.js +0 -106
- package/dist/static/styles/components/combobox.css.js +0 -49
- package/dist/static/styles/components/counter.css.js +0 -42
- package/dist/static/styles/components/dropdown-menu.css.js +0 -52
- package/dist/static/styles/components/narrow-panel.css.js +0 -38
- package/dist/static/styles/components/switcher.css.js +0 -11
- package/dist/static/styles/components/tabs.css.js +0 -97
- package/dist/static/styles/components/tools.css.js +0 -23
- package/dist/static/styles/components/version-history.css.js +0 -30
- package/dist/static/styles/components/wide-panel.css.js +0 -135
- package/dist/static/styles/variables.css.js +0 -23
- package/dist/utils/htmlCompiler.d.ts +0 -12
- package/dist/utils/htmlCompiler.js +0 -70
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
var y = Object.defineProperty;
|
|
2
|
-
var g = (p, e, r) => e in p ? y(p, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : p[e] = r;
|
|
3
|
-
var u = (p, e, r) => g(p, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { useToaster as m } from "../composables/useToaster.js";
|
|
5
|
-
class d {
|
|
6
|
-
constructor(e = []) {
|
|
7
|
-
u(this, "rules");
|
|
8
|
-
this.rules = e;
|
|
9
|
-
}
|
|
10
|
-
compile(e, r) {
|
|
11
|
-
const l = performance.now(), t = e, o = e.length;
|
|
12
|
-
let s = e;
|
|
13
|
-
const a = [];
|
|
14
|
-
(r || this.rules).sort((n, c) => n.priority - c.priority).forEach((n) => {
|
|
15
|
-
const c = s.length;
|
|
16
|
-
s = this.applyRule(s, n), s.length !== c && a.push(n.id);
|
|
17
|
-
});
|
|
18
|
-
const i = s.length, R = o > 0 ? (o - i) / o * 100 : 0;
|
|
19
|
-
return {
|
|
20
|
-
originalHtml: t,
|
|
21
|
-
compiledHtml: s,
|
|
22
|
-
appliedRules: a,
|
|
23
|
-
// TODO: We can use stats for monitoring in the future
|
|
24
|
-
stats: {
|
|
25
|
-
originalSize: o,
|
|
26
|
-
compiledSize: i,
|
|
27
|
-
reductionPercentage: R,
|
|
28
|
-
executionTime: performance.now() - l
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
applyRule(e, r) {
|
|
33
|
-
try {
|
|
34
|
-
switch (r.type) {
|
|
35
|
-
case "replace":
|
|
36
|
-
return this.applyReplaceRule(e, r);
|
|
37
|
-
case "regex":
|
|
38
|
-
return this.applyRegexRule(e, r);
|
|
39
|
-
case "remove":
|
|
40
|
-
return this.applyRemoveRule(e, r);
|
|
41
|
-
case "custom":
|
|
42
|
-
return this.applyCustomRule(e, r);
|
|
43
|
-
default:
|
|
44
|
-
return e;
|
|
45
|
-
}
|
|
46
|
-
} catch (l) {
|
|
47
|
-
const { handleError: t } = m();
|
|
48
|
-
return t(l, `Failed to apply rule ${r.id}:`), e;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
applyReplaceRule(e, r) {
|
|
52
|
-
const { search: l, replacement: t, replaceAll: o = !0 } = r;
|
|
53
|
-
return o ? e.replaceAll(l, t) : e.replace(l, t);
|
|
54
|
-
}
|
|
55
|
-
applyRegexRule(e, r) {
|
|
56
|
-
const { pattern: l, replacement: t, flags: o = "g" } = r, s = new RegExp(l, o);
|
|
57
|
-
return e.replace(s, t);
|
|
58
|
-
}
|
|
59
|
-
applyRemoveRule(e, r) {
|
|
60
|
-
return r.targets.reduce((l, t) => t instanceof RegExp ? l.replace(t, "") : l.replaceAll(t, ""), e);
|
|
61
|
-
}
|
|
62
|
-
applyCustomRule(e, r) {
|
|
63
|
-
return r.processor(e);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
const A = (p = []) => new d(p);
|
|
67
|
-
export {
|
|
68
|
-
d as HtmlCompilerEngine,
|
|
69
|
-
A as createHtmlCompiler
|
|
70
|
-
};
|