@useinsider/guido 3.28.1-beta.70df1f2 → 3.28.1-beta.7539890
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 +3 -0
- package/dist/@types/display-condition.js +45 -21
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue.js +25 -19
- package/dist/components/organisms/display-conditions/DisplayConditionCreateDrawer.vue2.js +72 -53
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue.js +1 -1
- package/dist/components/organisms/display-conditions/DisplayConditionSelectDrawer.vue2.js +60 -42
- package/dist/components/organisms/display-conditions/LogicBuilderConnector.vue.js +18 -0
- package/dist/components/organisms/display-conditions/LogicBuilderConnector.vue2.js +25 -0
- package/dist/components/organisms/display-conditions/LogicBuilderField.vue.js +28 -0
- package/dist/components/organisms/display-conditions/LogicBuilderField.vue2.js +28 -0
- package/dist/components/organisms/display-conditions/LogicBuilderGroup.vue.js +30 -0
- package/dist/components/organisms/display-conditions/LogicBuilderGroup.vue2.js +32 -0
- package/dist/components/organisms/display-conditions/LogicBuilderRow.vue.js +28 -0
- package/dist/components/organisms/display-conditions/LogicBuilderRow.vue2.js +60 -0
- package/dist/composables/useDisplayConditionAttributes.js +20 -0
- package/dist/composables/useDisplayConditions.js +83 -68
- package/dist/composables/useScrollToInvalid.js +15 -0
- package/dist/enums/display-condition.js +15 -6
- package/dist/enums/html-validator.js +1 -1
- package/dist/extensions/DisplayConditions/constants.js +19 -10
- package/dist/extensions/DisplayConditions/control.js +84 -64
- package/dist/extensions/DisplayConditions/display-conditions.css.js +58 -6
- package/dist/extensions/DisplayConditions/extension.js +18 -14
- package/dist/guido.css +1 -1
- package/dist/node_modules/valibot/dist/index.js +118 -102
- package/dist/package.json.js +1 -1
- package/dist/services/displayConditionApi.js +18 -19
- package/dist/src/@types/display-condition.d.ts +67 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderConnector.vue.d.ts +19 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderField.vue.d.ts +22 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderGroup.vue.d.ts +24 -0
- package/dist/src/components/organisms/display-conditions/LogicBuilderRow.vue.d.ts +25 -0
- package/dist/src/composables/useDisplayConditionAttributes.d.ts +4 -0
- package/dist/src/composables/useDisplayConditions.d.ts +1 -1
- package/dist/src/composables/useScrollToInvalid.d.ts +6 -0
- package/dist/src/enums/display-condition.d.ts +22 -0
- package/dist/src/extensions/DisplayConditions/constants.d.ts +2 -0
- package/dist/src/extensions/DisplayConditions/control.d.ts +1 -0
- package/dist/src/utils/displayConditionAttributes.d.ts +7 -0
- package/dist/src/utils/displayConditionBuilder.d.ts +29 -0
- package/dist/src/utils/displayConditionRules.d.ts +12 -0
- package/dist/src/utils/displayConditionSummary.d.ts +11 -0
- package/dist/src/utils/genericUtil.d.ts +5 -3
- package/dist/utils/displayConditionAttributes.js +22 -0
- package/dist/utils/displayConditionBuilder.js +50 -0
- package/dist/utils/displayConditionRules.js +91 -0
- package/dist/utils/displayConditionSummary.js +28 -0
- package/dist/utils/genericUtil.js +41 -40
- package/package.json +2 -2
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var O = Object.defineProperty;
|
|
2
|
+
var S = (p, a, i) => a in p ? O(p, a, { enumerable: !0, configurable: !0, writable: !0, value: i }) : p[a] = i;
|
|
3
|
+
var h = (p, a, i) => S(p, typeof a != "symbol" ? a + "" : a, i);
|
|
4
|
+
import { getDisplayConditionAttributes as w } from "../../composables/useDisplayConditionAttributes.js";
|
|
5
|
+
import { useToaster as N } from "../../composables/useToaster.js";
|
|
6
|
+
import { useTranslations as E } from "../../composables/useTranslations.js";
|
|
7
|
+
import { DisplayConditionSourceType as T } from "../../enums/display-condition.js";
|
|
8
|
+
import { ToasterTypeOptions as D } from "../../enums/toaster.js";
|
|
9
|
+
import { CommonControl as R } from "../Blocks/common-control.js";
|
|
10
|
+
import { toAppliedCondition as $, parseSource as I } from "../../utils/displayCondition.js";
|
|
11
|
+
import { readLogicBuilderRules as L } from "../../utils/displayConditionRules.js";
|
|
12
|
+
import { summarizeRuleTree as M, OPERATOR_TRANS_SUFFIX as x } from "../../utils/displayConditionSummary.js";
|
|
13
|
+
import { escapeHtml as _ } from "../../utils/htmlEscape.js";
|
|
14
|
+
import { ModificationDescription as H } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
15
|
+
import { requestDisplayCondition as A } from "./bridge.js";
|
|
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 v, 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 R {
|
|
16
19
|
constructor() {
|
|
17
20
|
super(...arguments);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
h(this, "expanded", !1);
|
|
22
|
+
h(this, "listeners", []);
|
|
23
|
+
h(this, "resizeObserver", null);
|
|
24
|
+
h(this, "detachOutsideClick", null);
|
|
22
25
|
}
|
|
23
26
|
getId() {
|
|
24
|
-
return
|
|
27
|
+
return B;
|
|
25
28
|
}
|
|
26
29
|
getTemplate() {
|
|
27
30
|
return `
|
|
@@ -32,30 +35,31 @@ class F extends E {
|
|
|
32
35
|
</div>
|
|
33
36
|
<div class="guido-display-conditions__empty" data-dc-empty>
|
|
34
37
|
${this._GuButton({
|
|
35
|
-
name:
|
|
38
|
+
name: l.ADD,
|
|
36
39
|
id: "guido__btn-add-display-condition",
|
|
37
40
|
className: "guido-display-conditions__add",
|
|
38
|
-
icon:
|
|
41
|
+
icon: g.PLUS,
|
|
39
42
|
label: this.api.translate("Add Display Condition")
|
|
40
43
|
})}
|
|
41
44
|
<div class="guido-display-conditions__menu" data-dc-menu hidden>
|
|
42
45
|
${this._GuButton({
|
|
43
|
-
name:
|
|
44
|
-
id: "guido__btn-display-condition-
|
|
46
|
+
name: l.SELECT,
|
|
47
|
+
id: "guido__btn-display-condition-select",
|
|
45
48
|
className: "guido-display-conditions__menu-item",
|
|
46
|
-
label: this.api.translate("
|
|
49
|
+
label: this.api.translate("Select from Saved Conditions")
|
|
47
50
|
})}
|
|
48
51
|
${this._GuButton({
|
|
49
|
-
name:
|
|
50
|
-
id: "guido__btn-display-condition-
|
|
52
|
+
name: l.CREATE,
|
|
53
|
+
id: "guido__btn-display-condition-create",
|
|
51
54
|
className: "guido-display-conditions__menu-item",
|
|
52
|
-
label: this.api.translate("
|
|
55
|
+
label: this.api.translate("Create from Scratch")
|
|
53
56
|
})}
|
|
54
57
|
</div>
|
|
55
58
|
</div>
|
|
56
59
|
<div class="guido-display-conditions__applied" data-dc-applied hidden>
|
|
57
60
|
<div class="guido-display-conditions__code-box">
|
|
58
61
|
<p class="guido-display-conditions__name" data-dc-name></p>
|
|
62
|
+
<div class="guido-display-conditions__rules" data-dc-rules hidden></div>
|
|
59
63
|
<div class="guido-display-conditions__sections" data-dc-sections>
|
|
60
64
|
<p class="guido-display-conditions__section-label">
|
|
61
65
|
${this.api.translate("Code Before Module")}
|
|
@@ -67,33 +71,33 @@ class F extends E {
|
|
|
67
71
|
<pre class="guido-display-conditions__code" data-dc-after></pre>
|
|
68
72
|
</div>
|
|
69
73
|
${this._GuButton({
|
|
70
|
-
name:
|
|
74
|
+
name: l.SHOW_MORE,
|
|
71
75
|
id: "guido__btn-display-condition-show-more",
|
|
72
76
|
className: "guido-display-conditions__toggle",
|
|
73
|
-
icon:
|
|
77
|
+
icon: g.CHEVRON,
|
|
74
78
|
label: this.api.translate("Show More")
|
|
75
79
|
})}
|
|
76
80
|
${this._GuButton({
|
|
77
|
-
name:
|
|
81
|
+
name: l.SHOW_LESS,
|
|
78
82
|
id: "guido__btn-display-condition-show-less",
|
|
79
83
|
className: "guido-display-conditions__toggle guido-display-conditions__toggle--less",
|
|
80
|
-
icon:
|
|
84
|
+
icon: g.CHEVRON,
|
|
81
85
|
label: this.api.translate("Show Less")
|
|
82
86
|
})}
|
|
83
87
|
</div>
|
|
84
88
|
<div class="guido-display-conditions__actions">
|
|
85
89
|
${this._GuButton({
|
|
86
|
-
name:
|
|
90
|
+
name: l.EDIT,
|
|
87
91
|
id: "guido__btn-edit-display-condition",
|
|
88
92
|
className: "guido-display-conditions__action guido-display-conditions__action--edit",
|
|
89
|
-
icon:
|
|
93
|
+
icon: g.EDIT,
|
|
90
94
|
label: this.api.translate("Edit")
|
|
91
95
|
})}
|
|
92
96
|
${this._GuButton({
|
|
93
|
-
name:
|
|
97
|
+
name: l.REMOVE,
|
|
94
98
|
id: "guido__btn-remove-display-condition",
|
|
95
99
|
className: "guido-display-conditions__action guido-display-conditions__action--remove",
|
|
96
|
-
icon:
|
|
100
|
+
icon: g.TRASH,
|
|
97
101
|
label: this.api.translate("Remove")
|
|
98
102
|
})}
|
|
99
103
|
</div>
|
|
@@ -117,21 +121,21 @@ class F extends E {
|
|
|
117
121
|
getCondition() {
|
|
118
122
|
var t;
|
|
119
123
|
const i = this.currentNode;
|
|
120
|
-
return
|
|
124
|
+
return $((t = i == null ? void 0 : i.getDisplayCondition) == null ? void 0 : t.call(i));
|
|
121
125
|
}
|
|
122
126
|
toggleMenu(i) {
|
|
123
|
-
var o,
|
|
124
|
-
const t = (o = this.getContainer()) == null ? void 0 : o.querySelector(`${
|
|
127
|
+
var o, n, s;
|
|
128
|
+
const t = (o = this.getContainer()) == null ? void 0 : o.querySelector(`${c} [data-dc-menu]`);
|
|
125
129
|
if (!t)
|
|
126
130
|
return;
|
|
127
|
-
t.hidden = i === void 0 ? !t.hidden : !i, (
|
|
128
|
-
const e = (
|
|
131
|
+
t.hidden = i === void 0 ? !t.hidden : !i, (n = this.detachOutsideClick) == null || n.call(this), t.hidden || this.listenOutsideClick();
|
|
132
|
+
const e = (s = this.getContainer()) == null ? void 0 : s.querySelector(`${c} #guido__btn-add-display-condition`);
|
|
129
133
|
t.style.width = !t.hidden && e ? `${e.getBoundingClientRect().width}px` : "";
|
|
130
134
|
}
|
|
131
135
|
listenOutsideClick() {
|
|
132
136
|
var e;
|
|
133
137
|
const i = ((e = this.getContainer()) == null ? void 0 : e.ownerDocument) ?? document, t = (o) => {
|
|
134
|
-
o.composedPath().some((
|
|
138
|
+
o.composedPath().some((s) => s instanceof HTMLElement && s.matches(`${c} [data-dc-menu], ${c} #guido__btn-add-display-condition`)) || this.toggleMenu(!1);
|
|
135
139
|
};
|
|
136
140
|
i.addEventListener("pointerdown", t, !0), this.detachOutsideClick = () => {
|
|
137
141
|
i.removeEventListener("pointerdown", t, !0), this.detachOutsideClick = null;
|
|
@@ -139,16 +143,16 @@ class F extends E {
|
|
|
139
143
|
}
|
|
140
144
|
openDrawer(i) {
|
|
141
145
|
const t = this.currentNode;
|
|
142
|
-
this.toggleMenu(!1),
|
|
146
|
+
this.toggleMenu(!1), A(
|
|
143
147
|
{ mode: i, current: i === "edit" ? this.getCondition() : null },
|
|
144
148
|
{ onApply: (e) => this.applyCondition(e, t) }
|
|
145
149
|
);
|
|
146
150
|
}
|
|
147
151
|
// The drawer flows toast through useDisplayConditions; Remove has no drawer, so it toasts here.
|
|
148
152
|
removeCondition() {
|
|
149
|
-
this.applyCondition(null) ||
|
|
150
|
-
type:
|
|
151
|
-
message:
|
|
153
|
+
this.applyCondition(null) || N().showToaster({
|
|
154
|
+
type: D.Error,
|
|
155
|
+
message: E()("products.something-went-wrong")
|
|
152
156
|
});
|
|
153
157
|
}
|
|
154
158
|
// The panel can move to another block while the drawer is open; apply onto the block it was opened for.
|
|
@@ -157,7 +161,7 @@ class F extends E {
|
|
|
157
161
|
return !1;
|
|
158
162
|
try {
|
|
159
163
|
const e = this.api.getDocumentModifier().modifyHtml(t);
|
|
160
|
-
return e.setDisplayCondition(i ||
|
|
164
|
+
return e.setDisplayCondition(i || G), e.apply(new H(
|
|
161
165
|
i ? `Set display condition ${i.name}` : "Remove display condition"
|
|
162
166
|
)), !0;
|
|
163
167
|
} catch (e) {
|
|
@@ -166,7 +170,7 @@ class F extends E {
|
|
|
166
170
|
}
|
|
167
171
|
wire(i, t) {
|
|
168
172
|
var o;
|
|
169
|
-
const e = (o = this.getContainer()) == null ? void 0 : o.querySelector(`${
|
|
173
|
+
const e = (o = this.getContainer()) == null ? void 0 : o.querySelector(`${c} ${i}`);
|
|
170
174
|
e && (e.addEventListener("click", t), this.listeners.push({ element: e, handler: t }));
|
|
171
175
|
}
|
|
172
176
|
teardown() {
|
|
@@ -176,40 +180,56 @@ class F extends E {
|
|
|
176
180
|
// Line counts depend on layout: the panel font loads late and the panel can be resized.
|
|
177
181
|
observeCodeSize() {
|
|
178
182
|
var t;
|
|
179
|
-
const i = (t = this.getContainer()) == null ? void 0 : t.querySelectorAll(`${
|
|
183
|
+
const i = (t = this.getContainer()) == null ? void 0 : t.querySelectorAll(`${c} .guido-display-conditions__code`);
|
|
180
184
|
!(i != null && i.length) || typeof ResizeObserver > "u" || (this.resizeObserver = new ResizeObserver(() => this.paint()), i.forEach((e) => {
|
|
181
185
|
var o;
|
|
182
186
|
return (o = this.resizeObserver) == null ? void 0 : o.observe(e);
|
|
183
187
|
}));
|
|
184
188
|
}
|
|
185
189
|
paint() {
|
|
186
|
-
var
|
|
187
|
-
const i = (
|
|
190
|
+
var b;
|
|
191
|
+
const i = (b = this.getContainer()) == null ? void 0 : b.querySelector(c);
|
|
188
192
|
if (!i)
|
|
189
193
|
return;
|
|
190
|
-
const t = this.getCondition(), e = (
|
|
191
|
-
if (e("[data-dc-empty]").hidden = !!t, e("[data-dc-applied]").hidden = !t, e("[data-dc-description]").textContent = this.api.translate(t ?
|
|
194
|
+
const t = this.getCondition(), e = (m) => i.querySelector(m);
|
|
195
|
+
if (e("[data-dc-empty]").hidden = !!t, e("[data-dc-applied]").hidden = !t, e("[data-dc-description]").textContent = this.api.translate(t ? P : z), !t)
|
|
192
196
|
return;
|
|
193
197
|
e("[data-dc-name]").textContent = t.name;
|
|
194
|
-
const o =
|
|
198
|
+
const o = I(t) === T.INLINE;
|
|
195
199
|
e("#guido__btn-edit-display-condition").hidden = !o;
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
+
const n = e("[data-dc-sections]"), s = L(t.extraData), d = e("[data-dc-rules]");
|
|
201
|
+
if (n.hidden = !!s, d.hidden = !s, s) {
|
|
202
|
+
d.innerHTML = this.renderRules(s), e("#guido__btn-display-condition-show-more").hidden = !0, e("#guido__btn-display-condition-show-less").hidden = !0;
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const r = e("[data-dc-before]"), u = e("[data-dc-after]");
|
|
206
|
+
r.innerHTML = _(t.beforeScript), u.innerHTML = _(t.afterScript), u.hidden = !t.afterScript, e("[data-dc-after-label]").hidden = !t.afterScript, n.style.maxHeight = "";
|
|
207
|
+
const f = parseFloat(getComputedStyle(r).lineHeight) || 24, C = (m) => m.hidden ? 0 : Math.round(m.scrollHeight / f), y = C(r) + C(u) > v;
|
|
208
|
+
e("#guido__btn-display-condition-show-more").hidden = !y || this.expanded, e("#guido__btn-display-condition-show-less").hidden = !y || !this.expanded, y && !this.expanded && (n.style.maxHeight = `${this.collapsedHeight(n, [r, u], f)}px`);
|
|
209
|
+
}
|
|
210
|
+
renderRules(i) {
|
|
211
|
+
const t = w(), e = M(
|
|
212
|
+
i,
|
|
213
|
+
[...t.custom, ...t.default],
|
|
214
|
+
(n) => this.api.translate(k[x[n]])
|
|
215
|
+
), o = (n, s) => `<span class="guido-display-conditions__chip guido-display-conditions__chip--${s}">${_(this.api.translate(n))}</span>`;
|
|
216
|
+
return e.groups.map((n, s) => {
|
|
217
|
+
const d = n.lines.map((u) => `<p class="guido-display-conditions__rule">${_(u)}</p>`).join(o(n.condition, "rule"));
|
|
218
|
+
return `${s > 0 ? `<div class="guido-display-conditions__group-separator">${o(e.condition, "group")}</div>` : ""}<div class="guido-display-conditions__group"><p class="guido-display-conditions__rules-intro">${_(this.api.translate(q))}</p>${d}</div>`;
|
|
219
|
+
}).join("");
|
|
200
220
|
}
|
|
201
221
|
// Labels do not count toward the line limit, so the cut lands after the 10th rendered code line.
|
|
202
222
|
collapsedHeight(i, t, e) {
|
|
203
223
|
const { top: o } = i.getBoundingClientRect();
|
|
204
|
-
let
|
|
224
|
+
let n = v, s = 0;
|
|
205
225
|
return t.filter((d) => !d.hidden).forEach((d) => {
|
|
206
|
-
if (
|
|
226
|
+
if (n <= 0)
|
|
207
227
|
return;
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
}),
|
|
228
|
+
const r = Math.min(n, Math.round(d.scrollHeight / e));
|
|
229
|
+
s = d.getBoundingClientRect().top - o + r * e, n -= r;
|
|
230
|
+
}), s;
|
|
211
231
|
}
|
|
212
232
|
}
|
|
213
233
|
export {
|
|
214
|
-
|
|
234
|
+
oi as DisplayConditionsControl
|
|
215
235
|
};
|
|
@@ -122,6 +122,56 @@ 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
|
+
|
|
125
175
|
.guido-display-conditions .guido-display-conditions__toggle {
|
|
126
176
|
align-self: flex-start;
|
|
127
177
|
}
|
|
@@ -193,11 +243,13 @@ const n = `.guido-display-conditions {
|
|
|
193
243
|
.guido-display-conditions__menu {
|
|
194
244
|
position: absolute;
|
|
195
245
|
z-index: 2;
|
|
196
|
-
|
|
197
|
-
padding: 4px 0;
|
|
246
|
+
padding: 8px 0;
|
|
198
247
|
border-radius: 4px;
|
|
199
248
|
background-color: var(--guido-color-white);
|
|
200
|
-
box-shadow:
|
|
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);
|
|
201
253
|
}
|
|
202
254
|
|
|
203
255
|
.guido-display-conditions .guido-display-conditions__menu-item > .button {
|
|
@@ -207,11 +259,11 @@ const n = `.guido-display-conditions {
|
|
|
207
259
|
padding: 8px 16px;
|
|
208
260
|
border: 0;
|
|
209
261
|
background: none;
|
|
210
|
-
color: var(--guido-color-
|
|
262
|
+
color: var(--guido-color-gray-800);
|
|
211
263
|
cursor: pointer;
|
|
212
264
|
font: inherit;
|
|
213
|
-
font-size:
|
|
214
|
-
line-height:
|
|
265
|
+
font-size: 13px;
|
|
266
|
+
line-height: 16px;
|
|
215
267
|
text-align: left;
|
|
216
268
|
}
|
|
217
269
|
|
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { ExtensionBuilder as
|
|
2
|
-
import { APPLIED_DESCRIPTION as
|
|
3
|
-
import { DisplayConditionsControl as
|
|
4
|
-
import
|
|
5
|
-
import { DisplayConditionsIconsRegistry as
|
|
6
|
-
import { DisplayConditionsLibrary as
|
|
7
|
-
import { DisplayConditionsSettingsPanel as
|
|
8
|
-
const
|
|
1
|
+
import { ExtensionBuilder as n } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { RULES_INTRO as i, APPLIED_DESCRIPTION as t, EMPTY_DESCRIPTION as e, OPERATOR_LABELS as s } from "./constants.js";
|
|
3
|
+
import { DisplayConditionsControl as r } from "./control.js";
|
|
4
|
+
import d from "./display-conditions.css.js";
|
|
5
|
+
import { DisplayConditionsIconsRegistry as a } from "./iconsRegistry.js";
|
|
6
|
+
import { DisplayConditionsLibrary as l } from "./library.js";
|
|
7
|
+
import { DisplayConditionsSettingsPanel as C } from "./settingsPanel.js";
|
|
8
|
+
const E = new n().addControl(r).withIconsRegistry(a).withSettingsPanelRegistry(C).withExternalDisplayCondition(l).withStyles(d).withLocalization({
|
|
9
9
|
en: {
|
|
10
|
-
[
|
|
11
|
-
[
|
|
10
|
+
[e]: e,
|
|
11
|
+
[t]: t,
|
|
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
|
+
"Select from Saved Conditions": "Select from Saved Conditions",
|
|
18
|
+
"Create from Scratch": "Create from Scratch",
|
|
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"
|
|
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]))
|
|
24
28
|
}
|
|
25
29
|
}).build();
|
|
26
30
|
export {
|
|
27
|
-
|
|
31
|
+
E as default
|
|
28
32
|
};
|
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-display-condition-create__separator[data-v-
|
|
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-logic-builder-connector[data-v-6c88ce0c]{position:relative;display:flex;justify-content:center}.guido-logic-builder-connector[data-v-6c88ce0c]:before{position:absolute;top:50%;right:0;left:0;height:1px;background-color:#e1e1e1;content:""}.guido-logic-builder-connector>*[data-v-6c88ce0c]{position:relative}.guido-logic-builder-row[data-v-8a2effc2]{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:start;column-gap:22px;padding:32px 16px}.guido-logic-builder-row[data-v-8a2effc2] .in-tags-wrapper__label{display:none}.guido-logic-builder-row__actions[data-v-8a2effc2]{display:flex;gap:0}.guido-logic-builder-group[data-v-3de36f36]{border:1px solid #E1E1E1;border-radius:4px}.guido-logic-builder-group__footer[data-v-3de36f36]{padding:16px;border-top:1px solid #E1E1E1}.guido-logic-builder__group-connector[data-v-111861b4]{margin:24px 0}.guido-logic-builder__footer[data-v-111861b4]{display:flex;justify-content:center;margin-top:24px}.guido-display-condition-create__separator[data-v-e341027d]{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-e341027d]{gap:16px}.guido-display-condition-select-root[data-v-dbda3fdd] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-dbda3fdd]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-dbda3fdd] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-dbda3fdd] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-dbda3fdd]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-dbda3fdd]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-dbda3fdd]{min-width:0}.guido-display-condition-card__name[data-v-dbda3fdd],.guido-display-condition-card__description[data-v-dbda3fdd]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-dbda3fdd]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-dbda3fdd]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-dbda3fdd]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-dbda3fdd]{width:1px;height:24px}.guido-display-condition-card__code[data-v-dbda3fdd]{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}
|