@useinsider/guido 3.28.1-beta.d3309a6 → 3.28.1-beta.ff58f9a
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 +0 -10
- package/dist/@types/config/schemas.js +129 -142
- package/dist/@types/display-condition.js +21 -45
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +19 -25
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +55 -77
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +1 -1
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +43 -62
- package/dist/composables/useDisplayConditions.js +68 -83
- package/dist/enums/html-validator.js +1 -1
- package/dist/extensions/DisplayConditions/constants.js +10 -19
- package/dist/extensions/DisplayConditions/control.js +99 -120
- package/dist/extensions/DisplayConditions/display-conditions.css.js +6 -58
- package/dist/extensions/DisplayConditions/extension.js +14 -18
- package/dist/guido.css +1 -1
- package/dist/node_modules/valibot/dist/index.js +102 -118
- package/dist/package.json.js +1 -1
- package/dist/services/displayConditionApi.js +19 -18
- package/dist/src/@types/config/schemas.d.ts +0 -65
- package/dist/src/@types/display-condition.d.ts +0 -67
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +2 -42
- package/dist/src/composables/useDisplayConditions.d.ts +1 -1
- package/dist/src/extensions/DisplayConditions/constants.d.ts +0 -2
- package/dist/src/extensions/DisplayConditions/control.d.ts +0 -1
- package/dist/src/stores/config.d.ts +21 -441
- package/package.json +2 -2
- package/dist/components/organisms/display-conditions/LogicBuilderConnector.vue.js +0 -18
- package/dist/components/organisms/display-conditions/LogicBuilderConnector.vue2.js +0 -25
- package/dist/components/organisms/display-conditions/LogicBuilderField.vue.js +0 -28
- package/dist/components/organisms/display-conditions/LogicBuilderField.vue2.js +0 -28
- package/dist/components/organisms/display-conditions/LogicBuilderGroup.vue.js +0 -30
- package/dist/components/organisms/display-conditions/LogicBuilderGroup.vue2.js +0 -32
- package/dist/components/organisms/display-conditions/LogicBuilderRow.vue.js +0 -28
- package/dist/components/organisms/display-conditions/LogicBuilderRow.vue2.js +0 -60
- package/dist/composables/useScrollToInvalid.js +0 -15
- package/dist/src/components/organisms/display-conditions/LogicBuilderConnector.vue.d.ts +0 -19
- package/dist/src/components/organisms/display-conditions/LogicBuilderField.vue.d.ts +0 -22
- package/dist/src/components/organisms/display-conditions/LogicBuilderGroup.vue.d.ts +0 -24
- package/dist/src/components/organisms/display-conditions/LogicBuilderRow.vue.d.ts +0 -25
- package/dist/src/composables/useScrollToInvalid.d.ts +0 -6
- package/dist/src/utils/displayConditionBuilder.d.ts +0 -29
- package/dist/src/utils/displayConditionRules.d.ts +0 -12
- package/dist/src/utils/displayConditionSummary.d.ts +0 -11
- package/dist/utils/displayConditionBuilder.js +0 -50
- package/dist/utils/displayConditionRules.js +0 -91
- package/dist/utils/displayConditionSummary.js +0 -28
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useToaster as
|
|
5
|
-
import { useTranslations as
|
|
6
|
-
import { DisplayConditionSourceType as
|
|
7
|
-
import { ToasterTypeOptions as
|
|
8
|
-
import { CommonControl as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import { CONDITIONS_CONTROL_ID as B, CONDITION_ICONS as g, CONDITION_BUTTONS as l, APPLIED_DESCRIPTION as P, EMPTY_DESCRIPTION as z, MAX_COLLAPSED_LINES as b, OPERATOR_LABELS as k, RULES_INTRO as q } from "./constants.js";
|
|
17
|
-
const c = ".guido-display-conditions", G = { id: 0, name: "", description: "", beforeScript: "", afterScript: "" };
|
|
18
|
-
class oi extends D {
|
|
1
|
+
var b = Object.defineProperty;
|
|
2
|
+
var v = (c, a, i) => a in c ? b(c, a, { enumerable: !0, configurable: !0, writable: !0, value: i }) : c[a] = i;
|
|
3
|
+
var u = (c, a, i) => v(c, typeof a != "symbol" ? a + "" : a, i);
|
|
4
|
+
import { useToaster as O } from "../../composables/useToaster.js";
|
|
5
|
+
import { useTranslations as w } from "../../composables/useTranslations.js";
|
|
6
|
+
import { DisplayConditionSourceType as N } from "../../enums/display-condition.js";
|
|
7
|
+
import { ToasterTypeOptions as S } from "../../enums/toaster.js";
|
|
8
|
+
import { CommonControl as E } from "../Blocks/common-control.js";
|
|
9
|
+
import { toAppliedCondition as D, parseSource as T } from "../../utils/displayCondition.js";
|
|
10
|
+
import { escapeHtml as f } from "../../utils/htmlEscape.js";
|
|
11
|
+
import { ModificationDescription as I } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
12
|
+
import { requestDisplayCondition as M } from "./bridge.js";
|
|
13
|
+
import { CONDITIONS_CONTROL_ID as $, CONDITION_ICONS as h, CONDITION_BUTTONS as r, APPLIED_DESCRIPTION as x, EMPTY_DESCRIPTION as L, MAX_COLLAPSED_LINES as C } from "./constants.js";
|
|
14
|
+
const l = ".guido-display-conditions", R = { id: 0, name: "", description: "", beforeScript: "", afterScript: "" };
|
|
15
|
+
class F extends E {
|
|
19
16
|
constructor() {
|
|
20
17
|
super(...arguments);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
u(this, "expanded", !1);
|
|
19
|
+
u(this, "listeners", []);
|
|
20
|
+
u(this, "resizeObserver", null);
|
|
21
|
+
u(this, "detachOutsideClick", null);
|
|
25
22
|
}
|
|
26
23
|
getId() {
|
|
27
|
-
return
|
|
24
|
+
return $;
|
|
28
25
|
}
|
|
29
26
|
getTemplate() {
|
|
30
27
|
return `
|
|
@@ -35,31 +32,30 @@ class oi extends D {
|
|
|
35
32
|
</div>
|
|
36
33
|
<div class="guido-display-conditions__empty" data-dc-empty>
|
|
37
34
|
${this._GuButton({
|
|
38
|
-
name:
|
|
35
|
+
name: r.ADD,
|
|
39
36
|
id: "guido__btn-add-display-condition",
|
|
40
37
|
className: "guido-display-conditions__add",
|
|
41
|
-
icon:
|
|
38
|
+
icon: h.PLUS,
|
|
42
39
|
label: this.api.translate("Add Display Condition")
|
|
43
40
|
})}
|
|
44
41
|
<div class="guido-display-conditions__menu" data-dc-menu hidden>
|
|
45
42
|
${this._GuButton({
|
|
46
|
-
name:
|
|
47
|
-
id: "guido__btn-display-condition-
|
|
43
|
+
name: r.CREATE,
|
|
44
|
+
id: "guido__btn-display-condition-create",
|
|
48
45
|
className: "guido-display-conditions__menu-item",
|
|
49
|
-
label: this.api.translate("
|
|
46
|
+
label: this.api.translate("Create New Condition")
|
|
50
47
|
})}
|
|
51
48
|
${this._GuButton({
|
|
52
|
-
name:
|
|
53
|
-
id: "guido__btn-display-condition-
|
|
49
|
+
name: r.SELECT,
|
|
50
|
+
id: "guido__btn-display-condition-select",
|
|
54
51
|
className: "guido-display-conditions__menu-item",
|
|
55
|
-
label: this.api.translate("
|
|
52
|
+
label: this.api.translate("Select Saved Condition")
|
|
56
53
|
})}
|
|
57
54
|
</div>
|
|
58
55
|
</div>
|
|
59
56
|
<div class="guido-display-conditions__applied" data-dc-applied hidden>
|
|
60
57
|
<div class="guido-display-conditions__code-box">
|
|
61
58
|
<p class="guido-display-conditions__name" data-dc-name></p>
|
|
62
|
-
<div class="guido-display-conditions__rules" data-dc-rules hidden></div>
|
|
63
59
|
<div class="guido-display-conditions__sections" data-dc-sections>
|
|
64
60
|
<p class="guido-display-conditions__section-label">
|
|
65
61
|
${this.api.translate("Code Before Module")}
|
|
@@ -71,33 +67,33 @@ class oi extends D {
|
|
|
71
67
|
<pre class="guido-display-conditions__code" data-dc-after></pre>
|
|
72
68
|
</div>
|
|
73
69
|
${this._GuButton({
|
|
74
|
-
name:
|
|
70
|
+
name: r.SHOW_MORE,
|
|
75
71
|
id: "guido__btn-display-condition-show-more",
|
|
76
72
|
className: "guido-display-conditions__toggle",
|
|
77
|
-
icon:
|
|
73
|
+
icon: h.CHEVRON,
|
|
78
74
|
label: this.api.translate("Show More")
|
|
79
75
|
})}
|
|
80
76
|
${this._GuButton({
|
|
81
|
-
name:
|
|
77
|
+
name: r.SHOW_LESS,
|
|
82
78
|
id: "guido__btn-display-condition-show-less",
|
|
83
79
|
className: "guido-display-conditions__toggle guido-display-conditions__toggle--less",
|
|
84
|
-
icon:
|
|
80
|
+
icon: h.CHEVRON,
|
|
85
81
|
label: this.api.translate("Show Less")
|
|
86
82
|
})}
|
|
87
83
|
</div>
|
|
88
84
|
<div class="guido-display-conditions__actions">
|
|
89
85
|
${this._GuButton({
|
|
90
|
-
name:
|
|
86
|
+
name: r.EDIT,
|
|
91
87
|
id: "guido__btn-edit-display-condition",
|
|
92
88
|
className: "guido-display-conditions__action guido-display-conditions__action--edit",
|
|
93
|
-
icon:
|
|
89
|
+
icon: h.EDIT,
|
|
94
90
|
label: this.api.translate("Edit")
|
|
95
91
|
})}
|
|
96
92
|
${this._GuButton({
|
|
97
|
-
name:
|
|
93
|
+
name: r.REMOVE,
|
|
98
94
|
id: "guido__btn-remove-display-condition",
|
|
99
95
|
className: "guido-display-conditions__action guido-display-conditions__action--remove",
|
|
100
|
-
icon:
|
|
96
|
+
icon: h.TRASH,
|
|
101
97
|
label: this.api.translate("Remove")
|
|
102
98
|
})}
|
|
103
99
|
</div>
|
|
@@ -108,129 +104,112 @@ class oi extends D {
|
|
|
108
104
|
onRender() {
|
|
109
105
|
this.forgetLastPanelNode(), this.teardown(), this.wire("#guido__btn-add-display-condition", () => this.toggleMenu()), this.wire("#guido__btn-display-condition-create", () => this.openDrawer("create")), this.wire("#guido__btn-display-condition-select", () => this.openDrawer("select")), this.wire("#guido__btn-edit-display-condition", () => this.openDrawer("edit")), this.wire("#guido__btn-remove-display-condition", () => this.removeCondition()), this.wire("#guido__btn-display-condition-show-more", () => this.setExpanded(!0)), this.wire("#guido__btn-display-condition-show-less", () => this.setExpanded(!1)), this.observeCodeSize();
|
|
110
106
|
}
|
|
111
|
-
onTemplateNodeUpdated(
|
|
112
|
-
const
|
|
113
|
-
super.onTemplateNodeUpdated(
|
|
107
|
+
onTemplateNodeUpdated(i) {
|
|
108
|
+
const t = i !== this.currentNode;
|
|
109
|
+
super.onTemplateNodeUpdated(i), t && (this.expanded = !1, this.toggleMenu(!1)), this.paint();
|
|
114
110
|
}
|
|
115
111
|
onDestroy() {
|
|
116
112
|
super.onDestroy(), this.teardown();
|
|
117
113
|
}
|
|
118
|
-
setExpanded(
|
|
119
|
-
this.expanded =
|
|
114
|
+
setExpanded(i) {
|
|
115
|
+
this.expanded = i, this.paint();
|
|
120
116
|
}
|
|
121
117
|
getCondition() {
|
|
122
|
-
var
|
|
123
|
-
const
|
|
124
|
-
return
|
|
118
|
+
var t;
|
|
119
|
+
const i = this.currentNode;
|
|
120
|
+
return D((t = i == null ? void 0 : i.getDisplayCondition) == null ? void 0 : t.call(i));
|
|
125
121
|
}
|
|
126
|
-
toggleMenu(
|
|
127
|
-
var
|
|
128
|
-
const
|
|
129
|
-
if (!
|
|
122
|
+
toggleMenu(i) {
|
|
123
|
+
var o, s, n;
|
|
124
|
+
const t = (o = this.getContainer()) == null ? void 0 : o.querySelector(`${l} [data-dc-menu]`);
|
|
125
|
+
if (!t)
|
|
130
126
|
return;
|
|
131
|
-
|
|
132
|
-
const e = (
|
|
133
|
-
|
|
127
|
+
t.hidden = i === void 0 ? !t.hidden : !i, (s = this.detachOutsideClick) == null || s.call(this), t.hidden || this.listenOutsideClick();
|
|
128
|
+
const e = (n = this.getContainer()) == null ? void 0 : n.querySelector(`${l} #guido__btn-add-display-condition`);
|
|
129
|
+
t.style.width = !t.hidden && e ? `${e.getBoundingClientRect().width}px` : "";
|
|
134
130
|
}
|
|
135
131
|
listenOutsideClick() {
|
|
136
132
|
var e;
|
|
137
|
-
const
|
|
138
|
-
|
|
133
|
+
const i = ((e = this.getContainer()) == null ? void 0 : e.ownerDocument) ?? document, t = (o) => {
|
|
134
|
+
o.composedPath().some((n) => n instanceof HTMLElement && n.matches(`${l} [data-dc-menu], ${l} #guido__btn-add-display-condition`)) || this.toggleMenu(!1);
|
|
139
135
|
};
|
|
140
|
-
|
|
141
|
-
|
|
136
|
+
i.addEventListener("pointerdown", t, !0), this.detachOutsideClick = () => {
|
|
137
|
+
i.removeEventListener("pointerdown", t, !0), this.detachOutsideClick = null;
|
|
142
138
|
};
|
|
143
139
|
}
|
|
144
|
-
openDrawer(
|
|
145
|
-
const
|
|
146
|
-
this.toggleMenu(!1),
|
|
147
|
-
{ mode:
|
|
148
|
-
{ onApply: (e) => this.applyCondition(e,
|
|
140
|
+
openDrawer(i) {
|
|
141
|
+
const t = this.currentNode;
|
|
142
|
+
this.toggleMenu(!1), M(
|
|
143
|
+
{ mode: i, current: i === "edit" ? this.getCondition() : null },
|
|
144
|
+
{ onApply: (e) => this.applyCondition(e, t) }
|
|
149
145
|
);
|
|
150
146
|
}
|
|
151
147
|
// The drawer flows toast through useDisplayConditions; Remove has no drawer, so it toasts here.
|
|
152
148
|
removeCondition() {
|
|
153
|
-
this.applyCondition(null) ||
|
|
154
|
-
type:
|
|
155
|
-
message:
|
|
149
|
+
this.applyCondition(null) || O().showToaster({
|
|
150
|
+
type: S.Error,
|
|
151
|
+
message: w()("products.something-went-wrong")
|
|
156
152
|
});
|
|
157
153
|
}
|
|
158
154
|
// The panel can move to another block while the drawer is open; apply onto the block it was opened for.
|
|
159
|
-
applyCondition(
|
|
160
|
-
if (!
|
|
155
|
+
applyCondition(i, t = this.currentNode) {
|
|
156
|
+
if (!t)
|
|
161
157
|
return !1;
|
|
162
158
|
try {
|
|
163
|
-
const e = this.api.getDocumentModifier().modifyHtml(
|
|
164
|
-
return e.setDisplayCondition(
|
|
165
|
-
|
|
159
|
+
const e = this.api.getDocumentModifier().modifyHtml(t);
|
|
160
|
+
return e.setDisplayCondition(i || R), e.apply(new I(
|
|
161
|
+
i ? `Set display condition ${i.name}` : "Remove display condition"
|
|
166
162
|
)), !0;
|
|
167
163
|
} catch (e) {
|
|
168
164
|
return console.warn("Display condition could not be applied.", e), !1;
|
|
169
165
|
}
|
|
170
166
|
}
|
|
171
|
-
wire(
|
|
172
|
-
var
|
|
173
|
-
const e = (
|
|
174
|
-
e && (e.addEventListener("click",
|
|
167
|
+
wire(i, t) {
|
|
168
|
+
var o;
|
|
169
|
+
const e = (o = this.getContainer()) == null ? void 0 : o.querySelector(`${l} ${i}`);
|
|
170
|
+
e && (e.addEventListener("click", t), this.listeners.push({ element: e, handler: t }));
|
|
175
171
|
}
|
|
176
172
|
teardown() {
|
|
177
|
-
var
|
|
178
|
-
this.listeners.forEach(({ element: e, handler:
|
|
173
|
+
var i, t;
|
|
174
|
+
this.listeners.forEach(({ element: e, handler: o }) => e.removeEventListener("click", o)), this.listeners = [], (i = this.resizeObserver) == null || i.disconnect(), this.resizeObserver = null, (t = this.detachOutsideClick) == null || t.call(this);
|
|
179
175
|
}
|
|
180
176
|
// Line counts depend on layout: the panel font loads late and the panel can be resized.
|
|
181
177
|
observeCodeSize() {
|
|
182
|
-
var
|
|
183
|
-
const
|
|
184
|
-
!(
|
|
185
|
-
var
|
|
186
|
-
return (
|
|
178
|
+
var t;
|
|
179
|
+
const i = (t = this.getContainer()) == null ? void 0 : t.querySelectorAll(`${l} .guido-display-conditions__code`);
|
|
180
|
+
!(i != null && i.length) || typeof ResizeObserver > "u" || (this.resizeObserver = new ResizeObserver(() => this.paint()), i.forEach((e) => {
|
|
181
|
+
var o;
|
|
182
|
+
return (o = this.resizeObserver) == null ? void 0 : o.observe(e);
|
|
187
183
|
}));
|
|
188
184
|
}
|
|
189
185
|
paint() {
|
|
190
|
-
var
|
|
191
|
-
const
|
|
192
|
-
if (!
|
|
193
|
-
return;
|
|
194
|
-
const i = this.getCondition(), e = (y) => t.querySelector(y);
|
|
195
|
-
if (e("[data-dc-empty]").hidden = !!i, e("[data-dc-applied]").hidden = !i, e("[data-dc-description]").textContent = this.api.translate(i ? P : z), !i)
|
|
186
|
+
var y;
|
|
187
|
+
const i = (y = this.getContainer()) == null ? void 0 : y.querySelector(l);
|
|
188
|
+
if (!i)
|
|
196
189
|
return;
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
e("#guido__btn-edit-display-condition").hidden = !n;
|
|
200
|
-
const s = e("[data-dc-sections]"), o = L(i.extraData), d = e("[data-dc-rules]");
|
|
201
|
-
if (s.hidden = !!o, d.hidden = !o, o) {
|
|
202
|
-
d.innerHTML = this.renderRules(o), e("#guido__btn-display-condition-show-more").hidden = !0, e("#guido__btn-display-condition-show-less").hidden = !0;
|
|
190
|
+
const t = this.getCondition(), e = (_) => i.querySelector(_);
|
|
191
|
+
if (e("[data-dc-empty]").hidden = !!t, e("[data-dc-applied]").hidden = !t, e("[data-dc-description]").textContent = this.api.translate(t ? x : L), !t)
|
|
203
192
|
return;
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
var s;
|
|
212
|
-
const i = (s = R().template) == null ? void 0 : s.displayConditionAttributes, e = M(
|
|
213
|
-
t,
|
|
214
|
-
[...(i == null ? void 0 : i.custom) ?? [], ...(i == null ? void 0 : i.default) ?? []],
|
|
215
|
-
(o) => this.api.translate(k[x[o]])
|
|
216
|
-
), n = (o, d) => `<span class="guido-display-conditions__chip guido-display-conditions__chip--${d}">${_(this.api.translate(o))}</span>`;
|
|
217
|
-
return e.groups.map((o, d) => {
|
|
218
|
-
const a = o.lines.map((m) => `<p class="guido-display-conditions__rule">${_(m)}</p>`).join(n(o.condition, "rule"));
|
|
219
|
-
return `${d > 0 ? `<div class="guido-display-conditions__group-separator">${n(e.condition, "group")}</div>` : ""}<div class="guido-display-conditions__group"><p class="guido-display-conditions__rules-intro">${_(this.api.translate(q))}</p>${a}</div>`;
|
|
220
|
-
}).join("");
|
|
193
|
+
e("[data-dc-name]").textContent = t.name;
|
|
194
|
+
const o = T(t) === N.INLINE;
|
|
195
|
+
e("#guido__btn-edit-display-condition").hidden = !o;
|
|
196
|
+
const s = e("[data-dc-sections]"), n = e("[data-dc-before]"), d = e("[data-dc-after]");
|
|
197
|
+
n.innerHTML = f(t.beforeScript), d.innerHTML = f(t.afterScript), d.hidden = !t.afterScript, e("[data-dc-after-label]").hidden = !t.afterScript, s.style.maxHeight = "";
|
|
198
|
+
const p = parseFloat(getComputedStyle(n).lineHeight) || 24, m = (_) => _.hidden ? 0 : Math.round(_.scrollHeight / p), g = m(n) + m(d) > C;
|
|
199
|
+
e("#guido__btn-display-condition-show-more").hidden = !g || this.expanded, e("#guido__btn-display-condition-show-less").hidden = !g || !this.expanded, g && !this.expanded && (s.style.maxHeight = `${this.collapsedHeight(s, [n, d], p)}px`);
|
|
221
200
|
}
|
|
222
201
|
// Labels do not count toward the line limit, so the cut lands after the 10th rendered code line.
|
|
223
|
-
collapsedHeight(
|
|
224
|
-
const { top:
|
|
225
|
-
let s =
|
|
226
|
-
return
|
|
202
|
+
collapsedHeight(i, t, e) {
|
|
203
|
+
const { top: o } = i.getBoundingClientRect();
|
|
204
|
+
let s = C, n = 0;
|
|
205
|
+
return t.filter((d) => !d.hidden).forEach((d) => {
|
|
227
206
|
if (s <= 0)
|
|
228
207
|
return;
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
}),
|
|
208
|
+
const p = Math.min(s, Math.round(d.scrollHeight / e));
|
|
209
|
+
n = d.getBoundingClientRect().top - o + p * e, s -= p;
|
|
210
|
+
}), n;
|
|
232
211
|
}
|
|
233
212
|
}
|
|
234
213
|
export {
|
|
235
|
-
|
|
214
|
+
F as DisplayConditionsControl
|
|
236
215
|
};
|
|
@@ -122,56 +122,6 @@ const n = `.guido-display-conditions {
|
|
|
122
122
|
word-break: break-word;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
.guido-display-conditions__rules {
|
|
126
|
-
display: flex;
|
|
127
|
-
flex-direction: column;
|
|
128
|
-
gap: 16px;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.guido-display-conditions__rules[hidden] {
|
|
132
|
-
display: none;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.guido-display-conditions__group {
|
|
136
|
-
display: flex;
|
|
137
|
-
flex-direction: column;
|
|
138
|
-
align-items: flex-start;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
.guido-display-conditions__rules-intro,
|
|
142
|
-
.guido-display-conditions__rule {
|
|
143
|
-
margin: 0;
|
|
144
|
-
color: var(--guido-color-neutral-900);
|
|
145
|
-
font-size: 15px;
|
|
146
|
-
line-height: 24px;
|
|
147
|
-
word-break: break-word;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.guido-display-conditions__rule {
|
|
151
|
-
font-weight: 600;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.guido-display-conditions__group-separator {
|
|
155
|
-
display: flex;
|
|
156
|
-
justify-content: center;
|
|
157
|
-
margin: 0 -16px;
|
|
158
|
-
padding: 8px 0;
|
|
159
|
-
background: #FFFFFF;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.guido-display-conditions__chip {
|
|
163
|
-
padding: 0 8px;
|
|
164
|
-
border-radius: 4px;
|
|
165
|
-
background: var(--guido-color-neutral-200);
|
|
166
|
-
color: var(--guido-color-neutral-700);
|
|
167
|
-
font-size: 12px;
|
|
168
|
-
line-height: 24px;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
.guido-display-conditions__chip--rule {
|
|
172
|
-
margin: 4px 0;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
125
|
.guido-display-conditions .guido-display-conditions__toggle {
|
|
176
126
|
align-self: flex-start;
|
|
177
127
|
}
|
|
@@ -243,13 +193,11 @@ const n = `.guido-display-conditions {
|
|
|
243
193
|
.guido-display-conditions__menu {
|
|
244
194
|
position: absolute;
|
|
245
195
|
z-index: 2;
|
|
246
|
-
|
|
196
|
+
margin-top: 4px;
|
|
197
|
+
padding: 4px 0;
|
|
247
198
|
border-radius: 4px;
|
|
248
199
|
background-color: var(--guido-color-white);
|
|
249
|
-
box-shadow:
|
|
250
|
-
0 0 0 1px rgba(0, 0, 0, 0.07),
|
|
251
|
-
0 15px 35px -5px rgba(0, 0, 0, 0.1),
|
|
252
|
-
0 8px 10px -6px rgba(0, 0, 0, 0.1);
|
|
200
|
+
box-shadow: 0 4px 16px rgba(34, 41, 56, 0.16);
|
|
253
201
|
}
|
|
254
202
|
|
|
255
203
|
.guido-display-conditions .guido-display-conditions__menu-item > .button {
|
|
@@ -259,11 +207,11 @@ const n = `.guido-display-conditions {
|
|
|
259
207
|
padding: 8px 16px;
|
|
260
208
|
border: 0;
|
|
261
209
|
background: none;
|
|
262
|
-
color: var(--guido-color-
|
|
210
|
+
color: var(--guido-color-neutral-800);
|
|
263
211
|
cursor: pointer;
|
|
264
212
|
font: inherit;
|
|
265
|
-
font-size:
|
|
266
|
-
line-height:
|
|
213
|
+
font-size: 14px;
|
|
214
|
+
line-height: 24px;
|
|
267
215
|
text-align: left;
|
|
268
216
|
}
|
|
269
217
|
|
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
import { ExtensionBuilder as
|
|
2
|
-
import {
|
|
3
|
-
import { DisplayConditionsControl as
|
|
4
|
-
import
|
|
5
|
-
import { DisplayConditionsIconsRegistry as
|
|
6
|
-
import { DisplayConditionsLibrary as
|
|
7
|
-
import { DisplayConditionsSettingsPanel as
|
|
8
|
-
const
|
|
1
|
+
import { ExtensionBuilder as t } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { APPLIED_DESCRIPTION as o, EMPTY_DESCRIPTION as i } from "./constants.js";
|
|
3
|
+
import { DisplayConditionsControl as e } from "./control.js";
|
|
4
|
+
import n from "./display-conditions.css.js";
|
|
5
|
+
import { DisplayConditionsIconsRegistry as s } from "./iconsRegistry.js";
|
|
6
|
+
import { DisplayConditionsLibrary as d } from "./library.js";
|
|
7
|
+
import { DisplayConditionsSettingsPanel as r } from "./settingsPanel.js";
|
|
8
|
+
const S = new t().addControl(e).withIconsRegistry(s).withSettingsPanelRegistry(r).withExternalDisplayCondition(d).withStyles(n).withLocalization({
|
|
9
9
|
en: {
|
|
10
|
-
[
|
|
11
|
-
[
|
|
10
|
+
[i]: i,
|
|
11
|
+
[o]: o,
|
|
12
12
|
Conditions: "Conditions",
|
|
13
13
|
Edit: "Edit",
|
|
14
14
|
Remove: "Remove",
|
|
15
15
|
"Display Conditions": "Display Conditions",
|
|
16
16
|
"Add Display Condition": "Add Display Condition",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
17
|
+
"Create New Condition": "Create New Condition",
|
|
18
|
+
"Select Saved Condition": "Select Saved Condition",
|
|
19
19
|
"Show More": "Show More",
|
|
20
20
|
"Show Less": "Show Less",
|
|
21
21
|
"Code Before Module": "Code Before Module",
|
|
22
22
|
"Code After Module": "Code After Module",
|
|
23
|
-
"Insider Display Conditions": "Insider Display Conditions"
|
|
24
|
-
[i]: i,
|
|
25
|
-
and: "and",
|
|
26
|
-
or: "or",
|
|
27
|
-
...Object.fromEntries(Object.values(s).map((o) => [o, o]))
|
|
23
|
+
"Insider Display Conditions": "Insider Display Conditions"
|
|
28
24
|
}
|
|
29
25
|
}).build();
|
|
30
26
|
export {
|
|
31
|
-
|
|
27
|
+
S as default
|
|
32
28
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-9d988e4b] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-0c5f11a1]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-0c5f11a1]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-0c5f11a1]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[data-v-fcba7e99] .vueperslides__bullets{pointer-events:none!important}[data-v-fcba7e99] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-1a34025a] .vueperslides__bullets{pointer-events:none!important}[data-v-1a34025a] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-8fc96a58] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}.ambiguous-dynamic-content-modal__content[data-v-2643213c]{padding-bottom:150px}
|