@rulecms/widget-vue 0.1.0 → 0.3.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/README.md +14 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +33 -5
- package/dist/index.js +786 -727
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,133 +1,144 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
return !(e != null && e.length) || e ===
|
|
1
|
+
var He = Object.defineProperty;
|
|
2
|
+
var Ge = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var ye = (e, t, n) => Ge(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { defineComponent as D, reactive as ze, watch as De, provide as Ye, renderSlot as se, computed as y, openBlock as m, createElementBlock as b, normalizeStyle as S, normalizeClass as F, createBlock as A, resolveDynamicComponent as R, withCtx as V, createTextVNode as ie, toDisplayString as Y, createCommentVNode as W, Fragment as I, normalizeProps as Z, guardReactiveProps as ge, mergeProps as qe, resolveComponent as Xe, renderList as z, createVNode as ne, createElementVNode as $, ref as B, onMounted as Ze, onBeforeUnmount as xe, inject as Je, unref as T } from "vue";
|
|
5
|
+
const _ = "default";
|
|
6
|
+
function Te(e, t) {
|
|
7
|
+
return !(e != null && e.length) || e === _ ? t : `${e}/${t}`;
|
|
8
8
|
}
|
|
9
|
-
const
|
|
10
|
-
function
|
|
9
|
+
const Qe = `RuleCMS widget: this widget config uses components from the default component library, but no "default" library is registered. The default library is registered by the consumer app: add the RuleCMS default source components package as a direct dependency and register it, e.g. libraries: { default: sourceComponentsModule } (statically imported for SSR) or libraries: { default: () => import('<default source components package>') }. See the @rulecms/widget-vue README.`;
|
|
10
|
+
function he(e) {
|
|
11
11
|
if (!e || typeof e != "object")
|
|
12
12
|
return !1;
|
|
13
13
|
const t = e;
|
|
14
14
|
return !!t.manifest && typeof t.manifest == "object" && !!t.components && typeof t.components == "object" && !Array.isArray(t.components);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
16
|
+
function et(e) {
|
|
17
|
+
if (he(e))
|
|
18
18
|
return e;
|
|
19
19
|
const t = e;
|
|
20
|
-
return
|
|
20
|
+
return he(t == null ? void 0 : t.default) ? t.default : null;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
return e.usesDefaultLibrary ? [
|
|
22
|
+
function J(e) {
|
|
23
|
+
return e.usesDefaultLibrary ? [_, ...e.libraryIds] : [...e.libraryIds];
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
if (t.usesDefaultLibrary && !(e != null && e[
|
|
27
|
-
throw new Error(
|
|
25
|
+
function be({ registrations: e, referenced: t }) {
|
|
26
|
+
if (t.usesDefaultLibrary && !(e != null && e[_]))
|
|
27
|
+
throw new Error(Qe);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function tt(e) {
|
|
30
|
+
const t = [], n = /* @__PURE__ */ new Set();
|
|
31
|
+
for (const o of e.values()) {
|
|
32
|
+
if (typeof o.stylesheet != "string")
|
|
33
|
+
continue;
|
|
34
|
+
const s = o.stylesheet.trim();
|
|
35
|
+
!s || n.has(s) || (n.add(s), t.push(s));
|
|
36
|
+
}
|
|
37
|
+
return t.length > 0 ? t : void 0;
|
|
38
|
+
}
|
|
39
|
+
function nt(e) {
|
|
30
40
|
const t = {};
|
|
31
|
-
for (const [
|
|
32
|
-
const
|
|
33
|
-
for (const [
|
|
34
|
-
t[
|
|
41
|
+
for (const [o, s] of e) {
|
|
42
|
+
const i = o === _;
|
|
43
|
+
for (const [c, d] of Object.entries(s.components))
|
|
44
|
+
t[i ? c : `${o}/${c}`] = d;
|
|
35
45
|
}
|
|
36
|
-
|
|
46
|
+
const n = tt(e);
|
|
47
|
+
return n ? { components: t, stylesheets: n } : { components: t };
|
|
37
48
|
}
|
|
38
|
-
function
|
|
49
|
+
function q() {
|
|
39
50
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
40
51
|
let s = 0;
|
|
41
52
|
function i(r, l) {
|
|
42
|
-
var
|
|
43
|
-
e.get(r) !== l && ((
|
|
53
|
+
var f;
|
|
54
|
+
e.get(r) !== l && ((f = l.manifest) != null && f.id && l.manifest.id !== r && console.warn(
|
|
44
55
|
`RuleCMS widget: component library registered as "${r}" declares manifest id "${l.manifest.id}". The registered id wins for resolution.`
|
|
45
56
|
), e.set(r, l), s += 1);
|
|
46
57
|
}
|
|
47
58
|
function c(r) {
|
|
48
|
-
const l =
|
|
59
|
+
const l = J(r), f = [...l].sort().join("|"), u = o.get(f);
|
|
49
60
|
if (u && u.loadedVersion === s)
|
|
50
61
|
return u.plugin;
|
|
51
|
-
const
|
|
62
|
+
const p = /* @__PURE__ */ new Map();
|
|
52
63
|
for (const g of l) {
|
|
53
|
-
const
|
|
54
|
-
|
|
64
|
+
const v = e.get(g);
|
|
65
|
+
v && p.set(g, v);
|
|
55
66
|
}
|
|
56
|
-
const h =
|
|
57
|
-
return o.set(
|
|
67
|
+
const h = nt(p);
|
|
68
|
+
return o.set(f, { loadedVersion: s, plugin: h }), h;
|
|
58
69
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
const { registrations: l, referenced:
|
|
62
|
-
for (const u of
|
|
70
|
+
function d(r) {
|
|
71
|
+
be(r);
|
|
72
|
+
const { registrations: l, referenced: f } = r;
|
|
73
|
+
for (const u of J(f)) {
|
|
63
74
|
if (e.has(u) || n.has(u))
|
|
64
75
|
continue;
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
76
|
+
const p = l == null ? void 0 : l[u];
|
|
77
|
+
if (!p) {
|
|
67
78
|
console.error(
|
|
68
79
|
`RuleCMS widget: no component library registered for libraryId "${u}"; its components will not render.`
|
|
69
80
|
), n.set(u, new Error(`No registration for libraryId "${u}"`));
|
|
70
81
|
continue;
|
|
71
82
|
}
|
|
72
|
-
if (typeof
|
|
83
|
+
if (typeof p == "function")
|
|
73
84
|
return null;
|
|
74
|
-
i(u,
|
|
85
|
+
i(u, p);
|
|
75
86
|
}
|
|
76
|
-
return c(
|
|
87
|
+
return c(f);
|
|
77
88
|
}
|
|
78
89
|
async function a(r) {
|
|
79
|
-
|
|
80
|
-
const { registrations: l, referenced:
|
|
90
|
+
be(r);
|
|
91
|
+
const { registrations: l, referenced: f } = r, u = J(f);
|
|
81
92
|
return await Promise.all(
|
|
82
|
-
u.map(async (
|
|
83
|
-
if (e.has(
|
|
93
|
+
u.map(async (p) => {
|
|
94
|
+
if (e.has(p) || n.has(p))
|
|
84
95
|
return;
|
|
85
|
-
const h = l == null ? void 0 : l[
|
|
96
|
+
const h = l == null ? void 0 : l[p];
|
|
86
97
|
if (!h) {
|
|
87
98
|
console.error(
|
|
88
|
-
`RuleCMS widget: no component library registered for libraryId "${
|
|
89
|
-
), n.set(
|
|
99
|
+
`RuleCMS widget: no component library registered for libraryId "${p}"; its components will not render.`
|
|
100
|
+
), n.set(p, new Error(`No registration for libraryId "${p}"`));
|
|
90
101
|
return;
|
|
91
102
|
}
|
|
92
103
|
if (typeof h != "function") {
|
|
93
|
-
i(
|
|
104
|
+
i(p, h);
|
|
94
105
|
return;
|
|
95
106
|
}
|
|
96
|
-
let g = t.get(
|
|
97
|
-
g || (g = h().then((
|
|
98
|
-
const
|
|
99
|
-
if (!
|
|
107
|
+
let g = t.get(p);
|
|
108
|
+
g || (g = h().then((v) => {
|
|
109
|
+
const C = et(v);
|
|
110
|
+
if (!C)
|
|
100
111
|
throw new Error(
|
|
101
|
-
`Registration for libraryId "${
|
|
112
|
+
`Registration for libraryId "${p}" did not resolve to a ComponentLibraryModule (expected { manifest, components }).`
|
|
102
113
|
);
|
|
103
|
-
i(
|
|
104
|
-
}).catch((
|
|
105
|
-
n.set(
|
|
106
|
-
`RuleCMS widget: failed to load component library "${
|
|
107
|
-
|
|
114
|
+
i(p, C);
|
|
115
|
+
}).catch((v) => {
|
|
116
|
+
n.set(p, v), console.error(
|
|
117
|
+
`RuleCMS widget: failed to load component library "${p}":`,
|
|
118
|
+
v
|
|
108
119
|
);
|
|
109
120
|
}).finally(() => {
|
|
110
|
-
t.delete(
|
|
111
|
-
}), t.set(
|
|
121
|
+
t.delete(p);
|
|
122
|
+
}), t.set(p, g)), await g;
|
|
112
123
|
})
|
|
113
|
-
), c(
|
|
124
|
+
), c(f);
|
|
114
125
|
}
|
|
115
|
-
return { resolveSync:
|
|
126
|
+
return { resolveSync: d, resolve: a };
|
|
116
127
|
}
|
|
117
|
-
const
|
|
128
|
+
const Po = {
|
|
118
129
|
Preview: "Preview",
|
|
119
130
|
Compose: "Compose",
|
|
120
131
|
RenderedPage: "RenderedPage"
|
|
121
|
-
},
|
|
132
|
+
}, re = {
|
|
122
133
|
DroppableBox: "droppable-box"
|
|
123
|
-
},
|
|
134
|
+
}, we = {
|
|
124
135
|
FlexStart: "flex-start",
|
|
125
136
|
FlexEnd: "flex-end",
|
|
126
137
|
Center: "center",
|
|
127
138
|
SpaceBetween: "space-between",
|
|
128
139
|
SpaceAround: "space-around",
|
|
129
140
|
SpaceEvenly: "space-evenly"
|
|
130
|
-
},
|
|
141
|
+
}, Eo = {
|
|
131
142
|
FlexStart: "flex-start",
|
|
132
143
|
FlexEnd: "flex-end",
|
|
133
144
|
Center: "center",
|
|
@@ -135,49 +146,49 @@ const xo = {
|
|
|
135
146
|
SpaceAround: "space-around",
|
|
136
147
|
SpaceEvenly: "space-evenly",
|
|
137
148
|
Stretch: "stretch"
|
|
138
|
-
},
|
|
149
|
+
}, Q = "cssAttrArray", $o = {
|
|
139
150
|
Phone: "phone",
|
|
140
151
|
Tablet: "tablet",
|
|
141
152
|
Desktop: "desktop"
|
|
142
|
-
},
|
|
153
|
+
}, Pe = {
|
|
143
154
|
ComposerComponent: "ComposerWidget",
|
|
144
155
|
Collection: "Collection",
|
|
145
156
|
MoveComponentHandle: "MoveWidgetHandle"
|
|
146
|
-
},
|
|
147
|
-
function
|
|
148
|
-
return typeof e == "string" && e.startsWith(
|
|
157
|
+
}, Ee = `${Pe.Collection}_`, ot = "dev.", st = "https://rulecms.com", it = "https://widget-cache.rulecms.com", rt = "/api/v1/c/widget/get", lt = "/api/v1/c/dev/widget/get";
|
|
158
|
+
function L(e) {
|
|
159
|
+
return typeof e == "string" && e.startsWith(ot);
|
|
149
160
|
}
|
|
150
|
-
function
|
|
151
|
-
return t ? t.replace(/\/$/, "") :
|
|
161
|
+
function ct(e, t) {
|
|
162
|
+
return t ? t.replace(/\/$/, "") : L(e) ? st : it;
|
|
152
163
|
}
|
|
153
|
-
function
|
|
164
|
+
function $e({
|
|
154
165
|
publishedKey: e,
|
|
155
166
|
token: t,
|
|
156
167
|
endpoint: n
|
|
157
168
|
}) {
|
|
158
|
-
const o =
|
|
159
|
-
return `${
|
|
169
|
+
const o = L(t), s = o ? lt : rt, i = o ? new URLSearchParams({ widgetKey: e, token: t }) : new URLSearchParams({ publishedKey: e, token: t });
|
|
170
|
+
return `${ct(t, n)}${s}?${i.toString()}`;
|
|
160
171
|
}
|
|
161
|
-
const
|
|
172
|
+
const Ro = ({ id: e, prefix: t }) => `${t}_${e}`, at = (e) => {
|
|
162
173
|
if (!(e != null && e.length) || !e.includes("_")) {
|
|
163
174
|
console.error(`Invalid drag item id: ${e}. Type does not exist.`);
|
|
164
175
|
return;
|
|
165
176
|
}
|
|
166
|
-
return
|
|
167
|
-
},
|
|
177
|
+
return ut(e);
|
|
178
|
+
}, Re = (e) => e.includes("_"), ut = (e) => {
|
|
168
179
|
const t = e.indexOf("_"), n = e.substring(0, t), o = e.substring(t + 1);
|
|
169
180
|
return {
|
|
170
181
|
prefix: n,
|
|
171
182
|
id: o
|
|
172
183
|
};
|
|
173
|
-
},
|
|
174
|
-
if (
|
|
184
|
+
}, Le = (e) => {
|
|
185
|
+
if (!Re(e))
|
|
175
186
|
return;
|
|
176
|
-
const n =
|
|
177
|
-
return (n == null ? void 0 : n.prefix) ===
|
|
187
|
+
const n = at(e);
|
|
188
|
+
return (n == null ? void 0 : n.prefix) === Pe.Collection || console.error(
|
|
178
189
|
"getCollectionIdForCollectionType - Invalid component type: ${componentType}. Invalid prefix type."
|
|
179
190
|
), n == null ? void 0 : n.id;
|
|
180
|
-
},
|
|
191
|
+
}, Lo = (e) => {
|
|
181
192
|
if (!(e != null && e.length)) {
|
|
182
193
|
console.error("getNameAndInstanceIdFromWidgetKey: Missing widget key");
|
|
183
194
|
return;
|
|
@@ -192,13 +203,13 @@ const Eo = ({ id: e, prefix: t }) => `${t}_${e}`, lt = (e) => {
|
|
|
192
203
|
return { name: n, instanceId: t[1] };
|
|
193
204
|
const s = t[1].split("@");
|
|
194
205
|
return { name: n, instanceId: s[0], parentId: s[1] };
|
|
195
|
-
},
|
|
206
|
+
}, Mo = (e) => {
|
|
196
207
|
if (!(e != null && e.length))
|
|
197
208
|
return { errorMessage: "getNameFromWidgetKey: Missing widget key" };
|
|
198
209
|
const t = e.split("$");
|
|
199
210
|
return t.length < 2 ? { errorMessage: "getNameFromWidgetKey: Invalid widget key format" } : { name: t[0] };
|
|
200
|
-
},
|
|
201
|
-
var s, i, c,
|
|
211
|
+
}, dt = (e) => {
|
|
212
|
+
var s, i, c, d;
|
|
202
213
|
if (!e)
|
|
203
214
|
return { error: "getWidgetKeyForCollection: Missing collection" };
|
|
204
215
|
if (!((s = e.name) != null && s.length))
|
|
@@ -206,10 +217,10 @@ const Eo = ({ id: e, prefix: t }) => `${t}_${e}`, lt = (e) => {
|
|
|
206
217
|
const t = (i = e.name) == null ? void 0 : i.trim().toLowerCase();
|
|
207
218
|
if (!((c = e.id) != null && c.length))
|
|
208
219
|
return { error: "getWidgetKeyForCollection: Missing collection id" };
|
|
209
|
-
const o = ((
|
|
220
|
+
const o = ((d = e.parentId) == null ? void 0 : d.length) ? `${e.id}@${e.parentId}` : `${e.id}`;
|
|
210
221
|
return { data: `${t}$${o}` };
|
|
211
|
-
},
|
|
212
|
-
var s, i, c,
|
|
222
|
+
}, pt = (e) => {
|
|
223
|
+
var s, i, c, d;
|
|
213
224
|
if (!e)
|
|
214
225
|
return { error: "getWidgetKeyForPublishedCollection: Missing collection" };
|
|
215
226
|
if (!((s = e.name) != null && s.length))
|
|
@@ -217,22 +228,22 @@ const Eo = ({ id: e, prefix: t }) => `${t}_${e}`, lt = (e) => {
|
|
|
217
228
|
const t = (i = e.name) == null ? void 0 : i.trim().toLowerCase();
|
|
218
229
|
if (!((c = e.publishedKey) != null && c.length))
|
|
219
230
|
return { error: "getWidgetKeyForPublishedCollection: Missing collection publishedKey" };
|
|
220
|
-
const o = ((
|
|
231
|
+
const o = ((d = e.parentId) == null ? void 0 : d.length) ? `${e.publishedKey}@${e.parentId}` : `${e.publishedKey}`;
|
|
221
232
|
return { data: `${t}$${o}` };
|
|
222
|
-
},
|
|
223
|
-
const t =
|
|
224
|
-
return `${
|
|
225
|
-
},
|
|
226
|
-
const t =
|
|
227
|
-
return `${
|
|
228
|
-
},
|
|
229
|
-
function
|
|
230
|
-
return `${e}${
|
|
233
|
+
}, No = (e) => {
|
|
234
|
+
const t = dt(e);
|
|
235
|
+
return `${Ee}${t.data}`;
|
|
236
|
+
}, Wo = (e) => {
|
|
237
|
+
const t = pt(e);
|
|
238
|
+
return `${Ee}${t.data}`;
|
|
239
|
+
}, ft = "---", mt = "___";
|
|
240
|
+
function yt(e, t) {
|
|
241
|
+
return `${e}${ft}${t}`;
|
|
231
242
|
}
|
|
232
|
-
function
|
|
233
|
-
return `${
|
|
243
|
+
function Oo(e, t, n) {
|
|
244
|
+
return `${yt(e, t)}${mt}${n}`;
|
|
234
245
|
}
|
|
235
|
-
function
|
|
246
|
+
function jo(e) {
|
|
236
247
|
const t = e.split(".");
|
|
237
248
|
if (t.length !== 3)
|
|
238
249
|
throw new Error(`Invalid version format: ${e}. Expected format: x.y.z`);
|
|
@@ -241,19 +252,19 @@ function Wo(e) {
|
|
|
241
252
|
throw new Error(`Invalid patch version: ${t[2]}. Expected a number.`);
|
|
242
253
|
return `${n}.${o}.${s + 1}`;
|
|
243
254
|
}
|
|
244
|
-
function
|
|
255
|
+
function le({
|
|
245
256
|
displayItemList: e,
|
|
246
257
|
widgetCollections: t
|
|
247
258
|
}) {
|
|
248
259
|
const n = /* @__PURE__ */ new Set();
|
|
249
260
|
let o = !1;
|
|
250
261
|
const s = (i) => {
|
|
251
|
-
var c,
|
|
262
|
+
var c, d, a;
|
|
252
263
|
if ((c = i == null ? void 0 : i.rows) != null && c.length) {
|
|
253
264
|
for (const r of i.rows)
|
|
254
|
-
if ((
|
|
265
|
+
if ((d = r == null ? void 0 : r.columns) != null && d.length)
|
|
255
266
|
for (const l of r.columns)
|
|
256
|
-
l.collection && s(l.collection.collectionRows), !(!l.type || l.type ===
|
|
267
|
+
l.collection && s(l.collection.collectionRows), !(!l.type || l.type === re.DroppableBox) && (Re(l.type) || (!((a = l.libraryId) != null && a.length) || l.libraryId === _ ? o = !0 : n.add(l.libraryId)));
|
|
257
268
|
}
|
|
258
269
|
};
|
|
259
270
|
s(e);
|
|
@@ -261,16 +272,16 @@ function ie({
|
|
|
261
272
|
s(i == null ? void 0 : i.collectionRows);
|
|
262
273
|
return { libraryIds: Array.from(n), usesDefaultLibrary: o };
|
|
263
274
|
}
|
|
264
|
-
const
|
|
265
|
-
function
|
|
275
|
+
const Me = Symbol("rulecms-widget-context");
|
|
276
|
+
function gt() {
|
|
266
277
|
return {
|
|
267
278
|
token: "",
|
|
268
279
|
endpoint: void 0,
|
|
269
280
|
libraries: void 0,
|
|
270
|
-
libraryRegistry:
|
|
281
|
+
libraryRegistry: q()
|
|
271
282
|
};
|
|
272
283
|
}
|
|
273
|
-
const
|
|
284
|
+
const Bo = /* @__PURE__ */ D({
|
|
274
285
|
__name: "RuleCMSWidgetProvider",
|
|
275
286
|
props: {
|
|
276
287
|
token: {},
|
|
@@ -278,97 +289,97 @@ const _o = /* @__PURE__ */ x({
|
|
|
278
289
|
libraries: {}
|
|
279
290
|
},
|
|
280
291
|
setup(e) {
|
|
281
|
-
const t = e, n =
|
|
282
|
-
return
|
|
292
|
+
const t = e, n = ze(gt());
|
|
293
|
+
return De(
|
|
283
294
|
() => [t.token, t.endpoint, t.libraries],
|
|
284
295
|
() => {
|
|
285
296
|
n.token = t.token, n.endpoint = t.endpoint, n.libraries = t.libraries;
|
|
286
297
|
},
|
|
287
298
|
{ immediate: !0 }
|
|
288
|
-
),
|
|
299
|
+
), Ye(Me, n), (o, s) => se(o.$slots, "default");
|
|
289
300
|
}
|
|
290
|
-
}),
|
|
301
|
+
}), ht = "1200px", Ne = "500px", We = "820px", Fo = ht, bt = "rulecms", wt = 1920, Ct = {
|
|
291
302
|
f: "auto",
|
|
292
303
|
q: "auto",
|
|
293
304
|
c: "limit"
|
|
294
|
-
},
|
|
305
|
+
}, vt = /^[A-Za-z0-9][A-Za-z0-9._\-/]*$/, At = 300, St = /^[A-Za-z0-9][A-Za-z0-9_-]*$/, It = 100, kt = /^https:\/\/[^\s"'()\\<>]+$/, Dt = 2e3, xt = /^[A-Za-z0-9_,.:\-/]*$/, Tt = 300, Pt = (e) => typeof e == "string" && e.length <= At && vt.test(e), Et = (e) => typeof e == "string" && e.length <= It && St.test(e), $t = (e) => typeof e == "string" && e.length <= Dt && kt.test(e), Rt = (e) => typeof e == "string" && e.length <= Tt && xt.test(e), Lt = (e) => Object.entries(e).map(([t, n]) => `${t}_${n}`).join(","), Mt = (e) => {
|
|
295
306
|
const t = {};
|
|
296
307
|
for (const n of e.split(",")) {
|
|
297
308
|
const o = n.trim(), s = o.indexOf("_");
|
|
298
309
|
s <= 0 || (t[o.slice(0, s)] = o.slice(s + 1));
|
|
299
310
|
}
|
|
300
311
|
return t;
|
|
301
|
-
},
|
|
312
|
+
}, Nt = ({
|
|
302
313
|
publicId: e,
|
|
303
|
-
cloudName: t =
|
|
314
|
+
cloudName: t = bt,
|
|
304
315
|
transformations: n,
|
|
305
|
-
width: o =
|
|
316
|
+
width: o = wt
|
|
306
317
|
}) => {
|
|
307
|
-
const s = typeof n == "string" ?
|
|
308
|
-
...
|
|
318
|
+
const s = typeof n == "string" ? Mt(n) : n, i = {
|
|
319
|
+
...Ct,
|
|
309
320
|
...s,
|
|
310
321
|
w: o
|
|
311
322
|
};
|
|
312
323
|
return encodeURI(
|
|
313
|
-
`https://res.cloudinary.com/${t}/image/upload/${
|
|
324
|
+
`https://res.cloudinary.com/${t}/image/upload/${Lt(i)}/${e}`
|
|
314
325
|
);
|
|
315
|
-
},
|
|
326
|
+
}, Wt = /^--[A-Za-z0-9_-]+$/, Ot = 200, Oe = (e) => {
|
|
316
327
|
if (typeof e != "string")
|
|
317
328
|
return !1;
|
|
318
329
|
const t = e.trim();
|
|
319
|
-
return t.length <=
|
|
320
|
-
},
|
|
330
|
+
return t.length <= Ot && Wt.test(t);
|
|
331
|
+
}, k = (e) => `var(${e.trim()})`, w = (e) => {
|
|
321
332
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
322
333
|
return;
|
|
323
334
|
const t = e.cssVariable;
|
|
324
335
|
if (t != null)
|
|
325
|
-
return
|
|
326
|
-
},
|
|
336
|
+
return Oe(t) ? t.trim() : void 0;
|
|
337
|
+
}, P = (e) => {
|
|
327
338
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
328
339
|
return !1;
|
|
329
340
|
const t = e.cssVariable;
|
|
330
|
-
return t == null ? !1 : !
|
|
331
|
-
},
|
|
332
|
-
const n =
|
|
333
|
-
return n ? { [t]:
|
|
334
|
-
},
|
|
335
|
-
if (typeof e != "object" || e === null || Array.isArray(e) ||
|
|
341
|
+
return t == null ? !1 : !Oe(t);
|
|
342
|
+
}, Vo = (e, t) => {
|
|
343
|
+
const n = w(e);
|
|
344
|
+
return n ? { [t]: k(n) } : void 0;
|
|
345
|
+
}, jt = (e) => {
|
|
346
|
+
if (typeof e != "object" || e === null || Array.isArray(e) || P(e))
|
|
336
347
|
return !1;
|
|
337
|
-
if (
|
|
348
|
+
if (w(e))
|
|
338
349
|
return !0;
|
|
339
350
|
const t = e;
|
|
340
|
-
return t.source === "none" ? !0 : t.source === "url" ?
|
|
341
|
-
},
|
|
351
|
+
return t.source === "none" ? !0 : t.source === "url" ? $t(t.url) : t.source === "cloudinary" ? !Pt(t.publicId) || t.cloudName !== void 0 && t.cloudName !== null && !Et(t.cloudName) ? !1 : t.transformations === void 0 || t.transformations === null || Rt(t.transformations) : !1;
|
|
352
|
+
}, Bt = ["px", "%", "em", "rem", "vh", "vw"], ce = ["inherit", "unset"], Ft = ["allSides", "top", "right", "bottom", "left"], M = (e, t = {}) => {
|
|
342
353
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
343
354
|
return !1;
|
|
344
355
|
const n = e;
|
|
345
|
-
return
|
|
346
|
-
},
|
|
356
|
+
return P(e) ? !1 : w(e) ? !0 : n.unit === "auto" ? t.allowAuto !== !1 : n.unit === "keyword" ? t.allowKeywords !== !1 && ce.includes(n.keyword) : Bt.includes(n.unit) ? typeof n.value != "number" || !Number.isFinite(n.value) ? !1 : t.allowNegative !== !1 || n.value >= 0 : !1;
|
|
357
|
+
}, Vt = (e, t = {}) => {
|
|
347
358
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
348
359
|
return !1;
|
|
349
360
|
const n = e;
|
|
350
|
-
for (const o of
|
|
361
|
+
for (const o of Ft) {
|
|
351
362
|
const s = n[o];
|
|
352
|
-
if (s != null && !
|
|
363
|
+
if (s != null && !M(s, t))
|
|
353
364
|
return !1;
|
|
354
365
|
}
|
|
355
366
|
return !0;
|
|
356
|
-
},
|
|
367
|
+
}, _t = [...ce, "transparent", "currentColor"], Kt = /^(#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})|rgba?\([^)]+\)|hsla?\([^)]+\))$/, ae = (e) => {
|
|
357
368
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
358
369
|
return !1;
|
|
359
370
|
const t = e;
|
|
360
|
-
return
|
|
361
|
-
},
|
|
362
|
-
const t =
|
|
363
|
-
return t ?
|
|
364
|
-
},
|
|
371
|
+
return P(e) ? !1 : w(e) ? !0 : t.unit === "keyword" ? _t.includes(t.keyword) : t.unit === "color" ? typeof t.value == "string" && Kt.test(t.value.trim()) : !1;
|
|
372
|
+
}, ue = (e) => {
|
|
373
|
+
const t = w(e);
|
|
374
|
+
return t ? k(t) : "unit" in e ? e.unit === "keyword" ? e.keyword : e.value.trim() : "";
|
|
375
|
+
}, Ut = (e, t) => typeof e == "object" && e !== null && !Array.isArray(e) ? !P(e) && !!w(e) : typeof e != "string" || !e.length ? !1 : t.includes(e) ? !0 : ce.includes(e), Ht = [
|
|
365
376
|
'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',
|
|
366
377
|
'Georgia, "Times New Roman", Times, serif',
|
|
367
378
|
"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",
|
|
368
379
|
"Arial, Helvetica, sans-serif",
|
|
369
380
|
'"Helvetica Neue", Helvetica, Arial, sans-serif',
|
|
370
381
|
"Verdana, Geneva, sans-serif"
|
|
371
|
-
],
|
|
382
|
+
], Gt = [
|
|
372
383
|
"normal",
|
|
373
384
|
"bold",
|
|
374
385
|
"100",
|
|
@@ -380,43 +391,43 @@ const _o = /* @__PURE__ */ x({
|
|
|
380
391
|
"700",
|
|
381
392
|
"800",
|
|
382
393
|
"900"
|
|
383
|
-
],
|
|
394
|
+
], zt = ["normal", "italic", "oblique"], Yt = [
|
|
384
395
|
"left",
|
|
385
396
|
"center",
|
|
386
397
|
"right",
|
|
387
398
|
"justify",
|
|
388
399
|
"start",
|
|
389
400
|
"end"
|
|
390
|
-
],
|
|
401
|
+
], qt = [
|
|
391
402
|
"none",
|
|
392
403
|
"underline",
|
|
393
404
|
"line-through",
|
|
394
405
|
"overline"
|
|
395
|
-
],
|
|
406
|
+
], Xt = [
|
|
396
407
|
"none",
|
|
397
408
|
"uppercase",
|
|
398
409
|
"lowercase",
|
|
399
410
|
"capitalize"
|
|
400
|
-
],
|
|
411
|
+
], ee = [
|
|
401
412
|
"visible",
|
|
402
413
|
"hidden",
|
|
403
414
|
"scroll",
|
|
404
415
|
"auto",
|
|
405
416
|
"clip"
|
|
406
|
-
],
|
|
417
|
+
], Zt = [
|
|
407
418
|
"flex-start",
|
|
408
419
|
"flex-end",
|
|
409
420
|
"center",
|
|
410
421
|
"space-between",
|
|
411
422
|
"space-around",
|
|
412
423
|
"space-evenly"
|
|
413
|
-
],
|
|
424
|
+
], Jt = [
|
|
414
425
|
"flex-start",
|
|
415
426
|
"flex-end",
|
|
416
427
|
"center",
|
|
417
428
|
"baseline",
|
|
418
429
|
"stretch"
|
|
419
|
-
],
|
|
430
|
+
], Qt = ["wrap", "nowrap"], en = [
|
|
420
431
|
"flex-start",
|
|
421
432
|
"flex-end",
|
|
422
433
|
"center",
|
|
@@ -424,12 +435,12 @@ const _o = /* @__PURE__ */ x({
|
|
|
424
435
|
"space-around",
|
|
425
436
|
"space-evenly",
|
|
426
437
|
"stretch"
|
|
427
|
-
],
|
|
438
|
+
], tn = [
|
|
428
439
|
"row",
|
|
429
440
|
"row-reverse",
|
|
430
441
|
"column",
|
|
431
442
|
"column-reverse"
|
|
432
|
-
],
|
|
443
|
+
], nn = ["cover", "contain", "auto"], on = [
|
|
433
444
|
"center center",
|
|
434
445
|
"center top",
|
|
435
446
|
"center bottom",
|
|
@@ -439,20 +450,20 @@ const _o = /* @__PURE__ */ x({
|
|
|
439
450
|
"right center",
|
|
440
451
|
"right top",
|
|
441
452
|
"right bottom"
|
|
442
|
-
],
|
|
453
|
+
], sn = [
|
|
443
454
|
"no-repeat",
|
|
444
455
|
"repeat",
|
|
445
456
|
"repeat-x",
|
|
446
457
|
"repeat-y",
|
|
447
458
|
"space",
|
|
448
459
|
"round"
|
|
449
|
-
],
|
|
460
|
+
], rn = [
|
|
450
461
|
"justifyContent",
|
|
451
462
|
"alignItems",
|
|
452
463
|
"flexWrap",
|
|
453
464
|
"alignContent",
|
|
454
465
|
"flexDirection"
|
|
455
|
-
],
|
|
466
|
+
], ln = [
|
|
456
467
|
"none",
|
|
457
468
|
"solid",
|
|
458
469
|
"dashed",
|
|
@@ -462,107 +473,107 @@ const _o = /* @__PURE__ */ x({
|
|
|
462
473
|
"ridge",
|
|
463
474
|
"inset",
|
|
464
475
|
"outset"
|
|
465
|
-
],
|
|
476
|
+
], cn = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !P(e) && !!w(e) : ln.includes(e), an = (e) => {
|
|
466
477
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
467
478
|
return !1;
|
|
468
479
|
const t = e;
|
|
469
|
-
return
|
|
470
|
-
},
|
|
480
|
+
return P(e) ? !1 : w(e) ? !0 : !(t.width !== void 0 && t.width !== null && !M(t.width, { allowAuto: !1, allowNegative: !1 }) || t.style !== void 0 && t.style !== null && !cn(t.style) || t.color !== void 0 && t.color !== null && !ae(t.color));
|
|
481
|
+
}, un = {
|
|
471
482
|
allowAuto: !1,
|
|
472
483
|
allowKeywords: !1,
|
|
473
484
|
allowNegative: !0
|
|
474
|
-
},
|
|
485
|
+
}, dn = {
|
|
475
486
|
allowAuto: !1,
|
|
476
487
|
allowKeywords: !1,
|
|
477
488
|
allowNegative: !1
|
|
478
|
-
},
|
|
489
|
+
}, pn = (e) => {
|
|
479
490
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
480
491
|
return !1;
|
|
481
492
|
const t = e;
|
|
482
|
-
if (
|
|
493
|
+
if (P(e))
|
|
483
494
|
return !1;
|
|
484
|
-
if (
|
|
495
|
+
if (w(e))
|
|
485
496
|
return !0;
|
|
486
497
|
for (const n of ["offsetX", "offsetY", "spread"]) {
|
|
487
498
|
const o = t[n];
|
|
488
|
-
if (o != null && !
|
|
499
|
+
if (o != null && !M(o, un))
|
|
489
500
|
return !1;
|
|
490
501
|
}
|
|
491
|
-
return !(t.blur !== void 0 && t.blur !== null && !
|
|
492
|
-
},
|
|
502
|
+
return !(t.blur !== void 0 && t.blur !== null && !M(t.blur, dn) || t.color !== void 0 && t.color !== null && !ae(t.color) || t.inset !== void 0 && t.inset !== null && typeof t.inset != "boolean");
|
|
503
|
+
}, fn = (e) => e ? e.cssVariable !== void 0 && e.cssVariable !== null || e.offsetX !== void 0 || e.offsetY !== void 0 || e.blur !== void 0 || e.spread !== void 0 || e.color !== void 0 : !1, mn = (e) => {
|
|
493
504
|
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
494
505
|
return !1;
|
|
495
506
|
const t = e;
|
|
496
|
-
return
|
|
497
|
-
},
|
|
498
|
-
if (!
|
|
507
|
+
return P(e) ? !1 : w(e) ? !0 : t.unit === "number" ? typeof t.value == "number" && Number.isFinite(t.value) && t.value > 0 : M(e, { allowAuto: !1, allowNegative: !1 });
|
|
508
|
+
}, yn = (e) => typeof e == "object" && e !== null && !Array.isArray(e) ? !P(e) && !!w(e) : typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 1, gn = (e) => {
|
|
509
|
+
if (!jt(e))
|
|
499
510
|
return {};
|
|
500
|
-
const t =
|
|
511
|
+
const t = w(e);
|
|
501
512
|
if (t)
|
|
502
|
-
return { backgroundImage:
|
|
513
|
+
return { backgroundImage: k(t) };
|
|
503
514
|
const n = e;
|
|
504
515
|
return n.source === "none" ? { backgroundImage: "none" } : n.source === "url" ? { backgroundImage: `url("${n.url}")` } : {
|
|
505
|
-
backgroundImage: `url("${
|
|
516
|
+
backgroundImage: `url("${Nt({
|
|
506
517
|
publicId: n.publicId,
|
|
507
518
|
cloudName: n.cloudName,
|
|
508
519
|
transformations: n.transformations
|
|
509
520
|
})}")`
|
|
510
521
|
};
|
|
511
|
-
},
|
|
512
|
-
const t =
|
|
513
|
-
return t ?
|
|
514
|
-
},
|
|
515
|
-
if (!
|
|
522
|
+
}, N = (e) => {
|
|
523
|
+
const t = w(e);
|
|
524
|
+
return t ? k(t) : "unit" in e ? e.unit === "auto" ? "auto" : e.unit === "keyword" ? e.keyword : `${e.value}${e.unit}` : "";
|
|
525
|
+
}, hn = (e) => {
|
|
526
|
+
if (!an(e))
|
|
516
527
|
return {};
|
|
517
|
-
const t =
|
|
528
|
+
const t = w(e);
|
|
518
529
|
if (t)
|
|
519
|
-
return { border:
|
|
530
|
+
return { border: k(t) };
|
|
520
531
|
const n = {};
|
|
521
|
-
if (e.width && (n.borderWidth =
|
|
522
|
-
const o =
|
|
523
|
-
n.borderStyle = o ?
|
|
532
|
+
if (e.width && (n.borderWidth = N(e.width)), e.style) {
|
|
533
|
+
const o = w(e.style);
|
|
534
|
+
n.borderStyle = o ? k(o) : e.style;
|
|
524
535
|
}
|
|
525
|
-
return e.color && (n.borderColor =
|
|
526
|
-
},
|
|
527
|
-
if (!
|
|
536
|
+
return e.color && (n.borderColor = ue(e.color)), n;
|
|
537
|
+
}, U = (e) => e ? N(e) : "0px", bn = (e) => {
|
|
538
|
+
if (!pn(e) || !fn(e))
|
|
528
539
|
return {};
|
|
529
|
-
const t =
|
|
540
|
+
const t = w(e);
|
|
530
541
|
if (t)
|
|
531
|
-
return { boxShadow:
|
|
542
|
+
return { boxShadow: k(t) };
|
|
532
543
|
const n = [
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
544
|
+
U(e.offsetX),
|
|
545
|
+
U(e.offsetY),
|
|
546
|
+
U(e.blur),
|
|
547
|
+
U(e.spread)
|
|
537
548
|
];
|
|
538
|
-
return e.color && n.push(
|
|
539
|
-
},
|
|
540
|
-
if (!
|
|
549
|
+
return e.color && n.push(ue(e.color)), e.inset && n.unshift("inset"), { boxShadow: n.join(" ") };
|
|
550
|
+
}, wn = (e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`, Cn = (e, t) => {
|
|
551
|
+
if (!Vt(e))
|
|
541
552
|
return {};
|
|
542
553
|
if (e.allSides)
|
|
543
|
-
return { [t]:
|
|
554
|
+
return { [t]: N(e.allSides) };
|
|
544
555
|
const n = {};
|
|
545
556
|
for (const o of ["top", "right", "bottom", "left"]) {
|
|
546
557
|
const s = e[o];
|
|
547
|
-
s && (n[`${t}${
|
|
558
|
+
s && (n[`${t}${wn(o)}`] = N(s));
|
|
548
559
|
}
|
|
549
560
|
return n;
|
|
550
|
-
},
|
|
551
|
-
if (!
|
|
561
|
+
}, vn = (e, t) => ae(e) ? { [t]: ue(e) } : {}, An = (e, t, n) => {
|
|
562
|
+
if (!Ut(e, n))
|
|
552
563
|
return {};
|
|
553
|
-
const o =
|
|
554
|
-
return o ? { [t]:
|
|
555
|
-
},
|
|
556
|
-
if (!
|
|
564
|
+
const o = w(e);
|
|
565
|
+
return o ? { [t]: k(o) } : { [t]: e };
|
|
566
|
+
}, Sn = (e, t, n = {}) => M(e, n) ? { [t]: N(e) } : {}, In = (e) => {
|
|
567
|
+
if (!mn(e))
|
|
557
568
|
return {};
|
|
558
|
-
const t =
|
|
559
|
-
return t ? { lineHeight:
|
|
560
|
-
},
|
|
561
|
-
if (!
|
|
569
|
+
const t = w(e);
|
|
570
|
+
return t ? { lineHeight: k(t) } : "unit" in e && e.unit === "number" ? { lineHeight: e.value } : { lineHeight: N(e) };
|
|
571
|
+
}, kn = (e) => {
|
|
572
|
+
if (!yn(e))
|
|
562
573
|
return {};
|
|
563
|
-
const t =
|
|
564
|
-
return t ? { opacity:
|
|
565
|
-
},
|
|
574
|
+
const t = w(e);
|
|
575
|
+
return t ? { opacity: k(t) } : { opacity: e };
|
|
576
|
+
}, de = {
|
|
566
577
|
// Box spacing (4-sided)
|
|
567
578
|
"margin-3-resolutions": { kind: "boxSpacing", cssProperty: "margin" },
|
|
568
579
|
"padding-3-resolutions": { kind: "boxSpacing", cssProperty: "padding" },
|
|
@@ -616,44 +627,44 @@ const _o = /* @__PURE__ */ x({
|
|
|
616
627
|
"justify-content-3-resolutions": {
|
|
617
628
|
kind: "enum",
|
|
618
629
|
cssProperty: "justifyContent",
|
|
619
|
-
allowedValues:
|
|
630
|
+
allowedValues: Zt
|
|
620
631
|
},
|
|
621
632
|
"align-items-3-resolutions": {
|
|
622
633
|
kind: "enum",
|
|
623
634
|
cssProperty: "alignItems",
|
|
624
|
-
allowedValues:
|
|
635
|
+
allowedValues: Jt
|
|
625
636
|
},
|
|
626
637
|
"flex-wrap-3-resolutions": {
|
|
627
638
|
kind: "enum",
|
|
628
639
|
cssProperty: "flexWrap",
|
|
629
|
-
allowedValues:
|
|
640
|
+
allowedValues: Qt
|
|
630
641
|
},
|
|
631
642
|
"align-content-3-resolutions": {
|
|
632
643
|
kind: "enum",
|
|
633
644
|
cssProperty: "alignContent",
|
|
634
|
-
allowedValues:
|
|
645
|
+
allowedValues: en
|
|
635
646
|
},
|
|
636
647
|
"flex-direction-3-resolutions": {
|
|
637
648
|
kind: "enum",
|
|
638
649
|
cssProperty: "flexDirection",
|
|
639
|
-
allowedValues:
|
|
650
|
+
allowedValues: tn
|
|
640
651
|
},
|
|
641
652
|
// Overflow — shorthand and longhands are independent attributes; when
|
|
642
653
|
// both are set, the browser's cascade decides the effective overflow.
|
|
643
654
|
"overflow-3-resolutions": {
|
|
644
655
|
kind: "enum",
|
|
645
656
|
cssProperty: "overflow",
|
|
646
|
-
allowedValues:
|
|
657
|
+
allowedValues: ee
|
|
647
658
|
},
|
|
648
659
|
"overflow-x-3-resolutions": {
|
|
649
660
|
kind: "enum",
|
|
650
661
|
cssProperty: "overflowX",
|
|
651
|
-
allowedValues:
|
|
662
|
+
allowedValues: ee
|
|
652
663
|
},
|
|
653
664
|
"overflow-y-3-resolutions": {
|
|
654
665
|
kind: "enum",
|
|
655
666
|
cssProperty: "overflowY",
|
|
656
|
-
allowedValues:
|
|
667
|
+
allowedValues: ee
|
|
657
668
|
},
|
|
658
669
|
// Color
|
|
659
670
|
"background-color-3-resolutions": { kind: "color", cssProperty: "backgroundColor" },
|
|
@@ -665,17 +676,17 @@ const _o = /* @__PURE__ */ x({
|
|
|
665
676
|
"background-size-3-resolutions": {
|
|
666
677
|
kind: "enum",
|
|
667
678
|
cssProperty: "backgroundSize",
|
|
668
|
-
allowedValues:
|
|
679
|
+
allowedValues: nn
|
|
669
680
|
},
|
|
670
681
|
"background-position-3-resolutions": {
|
|
671
682
|
kind: "enum",
|
|
672
683
|
cssProperty: "backgroundPosition",
|
|
673
|
-
allowedValues:
|
|
684
|
+
allowedValues: on
|
|
674
685
|
},
|
|
675
686
|
"background-repeat-3-resolutions": {
|
|
676
687
|
kind: "enum",
|
|
677
688
|
cssProperty: "backgroundRepeat",
|
|
678
|
-
allowedValues:
|
|
689
|
+
allowedValues: sn
|
|
679
690
|
},
|
|
680
691
|
// Opacity (0–1 number)
|
|
681
692
|
"opacity-3-resolutions": { kind: "opacity" },
|
|
@@ -683,7 +694,7 @@ const _o = /* @__PURE__ */ x({
|
|
|
683
694
|
"font-family-3-resolutions": {
|
|
684
695
|
kind: "enum",
|
|
685
696
|
cssProperty: "fontFamily",
|
|
686
|
-
allowedValues:
|
|
697
|
+
allowedValues: Ht
|
|
687
698
|
},
|
|
688
699
|
"font-size-3-resolutions": {
|
|
689
700
|
kind: "length",
|
|
@@ -693,12 +704,12 @@ const _o = /* @__PURE__ */ x({
|
|
|
693
704
|
"font-weight-3-resolutions": {
|
|
694
705
|
kind: "enum",
|
|
695
706
|
cssProperty: "fontWeight",
|
|
696
|
-
allowedValues:
|
|
707
|
+
allowedValues: Gt
|
|
697
708
|
},
|
|
698
709
|
"font-style-3-resolutions": {
|
|
699
710
|
kind: "enum",
|
|
700
711
|
cssProperty: "fontStyle",
|
|
701
|
-
allowedValues:
|
|
712
|
+
allowedValues: zt
|
|
702
713
|
},
|
|
703
714
|
"line-height-3-resolutions": { kind: "lineHeight" },
|
|
704
715
|
"letter-spacing-3-resolutions": {
|
|
@@ -709,68 +720,68 @@ const _o = /* @__PURE__ */ x({
|
|
|
709
720
|
"text-align-3-resolutions": {
|
|
710
721
|
kind: "enum",
|
|
711
722
|
cssProperty: "textAlign",
|
|
712
|
-
allowedValues:
|
|
723
|
+
allowedValues: Yt
|
|
713
724
|
},
|
|
714
725
|
"text-decoration-3-resolutions": {
|
|
715
726
|
kind: "enum",
|
|
716
727
|
cssProperty: "textDecoration",
|
|
717
|
-
allowedValues:
|
|
728
|
+
allowedValues: qt
|
|
718
729
|
},
|
|
719
730
|
"text-transform-3-resolutions": {
|
|
720
731
|
kind: "enum",
|
|
721
732
|
cssProperty: "textTransform",
|
|
722
|
-
allowedValues:
|
|
733
|
+
allowedValues: Xt
|
|
723
734
|
}
|
|
724
|
-
},
|
|
725
|
-
const n =
|
|
735
|
+
}, Dn = (e, t) => {
|
|
736
|
+
const n = de[e];
|
|
726
737
|
if (!n)
|
|
727
738
|
return {};
|
|
728
739
|
switch (n.kind) {
|
|
729
740
|
case "boxSpacing":
|
|
730
|
-
return
|
|
741
|
+
return Cn(t, n.cssProperty);
|
|
731
742
|
case "length":
|
|
732
|
-
return
|
|
743
|
+
return Sn(t, n.cssProperty, n.capabilities);
|
|
733
744
|
case "border":
|
|
734
|
-
return
|
|
745
|
+
return hn(t);
|
|
735
746
|
case "boxShadow":
|
|
736
|
-
return
|
|
747
|
+
return bn(t);
|
|
737
748
|
case "color":
|
|
738
|
-
return
|
|
749
|
+
return vn(t, n.cssProperty);
|
|
739
750
|
case "opacity":
|
|
740
|
-
return
|
|
751
|
+
return kn(t);
|
|
741
752
|
case "enum":
|
|
742
|
-
return
|
|
753
|
+
return An(t, n.cssProperty, n.allowedValues);
|
|
743
754
|
case "lineHeight":
|
|
744
|
-
return
|
|
755
|
+
return In(t);
|
|
745
756
|
case "backgroundImage":
|
|
746
|
-
return
|
|
757
|
+
return gn(t);
|
|
747
758
|
default:
|
|
748
759
|
return {};
|
|
749
760
|
}
|
|
750
|
-
},
|
|
751
|
-
Object.entries(
|
|
761
|
+
}, _o = Object.fromEntries(
|
|
762
|
+
Object.entries(de).filter(([, e]) => e.kind === "boxSpacing").map(([e, t]) => [
|
|
752
763
|
e,
|
|
753
764
|
t.cssProperty
|
|
754
765
|
])
|
|
755
|
-
),
|
|
756
|
-
(n) =>
|
|
757
|
-
) || e.display === "flex" ? e : { ...e, display: "flex" } : {},
|
|
766
|
+
), xn = (e) => e != null && e !== "", Tn = (e) => e ? !rn.some(
|
|
767
|
+
(n) => xn(e[n])
|
|
768
|
+
) || e.display === "flex" ? e : { ...e, display: "flex" } : {}, Pn = ({
|
|
758
769
|
dbEntryType: e,
|
|
759
770
|
libraryId: t,
|
|
760
771
|
sourceComponentsPlugin: n
|
|
761
772
|
}) => {
|
|
762
773
|
if (!(e != null && e.length))
|
|
763
774
|
return;
|
|
764
|
-
const o = n.components[
|
|
775
|
+
const o = n.components[Te(t, e)];
|
|
765
776
|
if (!o || !("defaultAttributeValues" in o))
|
|
766
777
|
return;
|
|
767
778
|
const i = o.defaultAttributeValues;
|
|
768
779
|
if (i != null && i.length)
|
|
769
|
-
return i.reduce((c,
|
|
780
|
+
return i.reduce((c, d) => ({
|
|
770
781
|
...c,
|
|
771
|
-
[
|
|
782
|
+
[d.name]: d.defaultValues
|
|
772
783
|
}), {});
|
|
773
|
-
},
|
|
784
|
+
}, O = ({
|
|
774
785
|
deviceDisplayType: e,
|
|
775
786
|
componentAttributes: t
|
|
776
787
|
}) => {
|
|
@@ -782,8 +793,8 @@ const _o = /* @__PURE__ */ x({
|
|
|
782
793
|
)) {
|
|
783
794
|
if (!s.includes("3-resolutions") || !i)
|
|
784
795
|
continue;
|
|
785
|
-
const c = i.all,
|
|
786
|
-
o[s] =
|
|
796
|
+
const c = i.all, d = c ?? i[e.toLowerCase()];
|
|
797
|
+
o[s] = d, de[s] && Object.assign(n, Dn(s, d));
|
|
787
798
|
}
|
|
788
799
|
return Object.keys(n).length || Object.keys(o).length ? {
|
|
789
800
|
styles: Object.keys(n).length ? n : void 0,
|
|
@@ -791,27 +802,27 @@ const _o = /* @__PURE__ */ x({
|
|
|
791
802
|
o
|
|
792
803
|
).length ? o : void 0
|
|
793
804
|
} : void 0;
|
|
794
|
-
},
|
|
805
|
+
}, En = ({
|
|
795
806
|
defaultAttributes: e,
|
|
796
807
|
userModifiedAttributes: t
|
|
797
808
|
}) => e ? t ? { ...e, ...t } : e : t;
|
|
798
|
-
function
|
|
809
|
+
function G(e) {
|
|
799
810
|
return e.componentAttributes ?? e.widgetAttributes;
|
|
800
811
|
}
|
|
801
|
-
function
|
|
812
|
+
function Ce({
|
|
802
813
|
col: e,
|
|
803
814
|
deviceDisplayType: t,
|
|
804
815
|
isComposeMode: n,
|
|
805
816
|
sourceComponentsPlugin: o
|
|
806
817
|
}) {
|
|
807
|
-
const s =
|
|
818
|
+
const s = G(e), i = Pn({
|
|
808
819
|
dbEntryType: e.type,
|
|
809
820
|
libraryId: e.libraryId,
|
|
810
821
|
sourceComponentsPlugin: o
|
|
811
|
-
}) || [], c =
|
|
822
|
+
}) || [], c = En({
|
|
812
823
|
defaultAttributes: i,
|
|
813
824
|
userModifiedAttributes: s
|
|
814
|
-
}), { styles:
|
|
825
|
+
}), { styles: d, componentAttributesSpecificToDeviceType: a } = O({
|
|
815
826
|
deviceDisplayType: t,
|
|
816
827
|
componentAttributes: c
|
|
817
828
|
}) || {
|
|
@@ -820,57 +831,57 @@ function be({
|
|
|
820
831
|
};
|
|
821
832
|
let r = {};
|
|
822
833
|
const l = {};
|
|
823
|
-
if (
|
|
824
|
-
for (const [u,
|
|
834
|
+
if (d)
|
|
835
|
+
for (const [u, p] of Object.entries(d))
|
|
825
836
|
n && l[u] || (r = {
|
|
826
837
|
...r,
|
|
827
|
-
[u]:
|
|
838
|
+
[u]: p
|
|
828
839
|
});
|
|
829
|
-
let
|
|
840
|
+
let f = G(e);
|
|
830
841
|
for (const u in a)
|
|
831
842
|
if (u.includes("3-resolutions")) {
|
|
832
|
-
|
|
833
|
-
...
|
|
843
|
+
f = {
|
|
844
|
+
...G(e) || {},
|
|
834
845
|
...a || {}
|
|
835
846
|
};
|
|
836
847
|
break;
|
|
837
848
|
}
|
|
838
849
|
return {
|
|
839
|
-
componentAttributesBasedOnDevice:
|
|
840
|
-
componentStyles:
|
|
850
|
+
componentAttributesBasedOnDevice: f,
|
|
851
|
+
componentStyles: Tn(r)
|
|
841
852
|
};
|
|
842
853
|
}
|
|
843
|
-
const
|
|
854
|
+
const $n = (e) => {
|
|
844
855
|
const t = (e == null ? void 0 : e.rows) || [];
|
|
845
856
|
for (const n of t)
|
|
846
857
|
if (((n == null ? void 0 : n.columns) || []).length > 0)
|
|
847
858
|
return !0;
|
|
848
859
|
return (e == null ? void 0 : e.containerAttributes) && Object.keys(e.containerAttributes).length > 0;
|
|
849
|
-
},
|
|
850
|
-
function
|
|
860
|
+
}, Rn = "var(--sl-spacing-x-small)";
|
|
861
|
+
function Ln(e) {
|
|
851
862
|
return e != null && e.horizontalAlignment || e != null && e.verticalAlignment || e != null && e.flexWrap || e != null && e.gap || e != null && e.alignContent ? !0 : !!(e != null && e.rowAttributes && Object.keys(e.rowAttributes).length > 0);
|
|
852
863
|
}
|
|
853
|
-
function
|
|
864
|
+
function Mn({
|
|
854
865
|
row: e,
|
|
855
866
|
deviceDisplayType: t
|
|
856
867
|
}) {
|
|
857
868
|
var o;
|
|
858
|
-
const n =
|
|
869
|
+
const n = O({
|
|
859
870
|
deviceDisplayType: t,
|
|
860
871
|
componentAttributes: e.rowAttributes
|
|
861
872
|
});
|
|
862
873
|
return ((o = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : o["hide-component-3-resolutions"]) === "true";
|
|
863
874
|
}
|
|
864
|
-
function
|
|
875
|
+
function Nn({
|
|
865
876
|
row: e,
|
|
866
877
|
deviceDisplayType: t,
|
|
867
878
|
isComposeMode: n
|
|
868
879
|
}) {
|
|
869
|
-
var
|
|
870
|
-
const o = ((
|
|
880
|
+
var p;
|
|
881
|
+
const o = ((p = O({
|
|
871
882
|
deviceDisplayType: t,
|
|
872
883
|
componentAttributes: e.rowAttributes
|
|
873
|
-
})) == null ? void 0 :
|
|
884
|
+
})) == null ? void 0 : p.styles) || {}, s = o.justifyContent ?? e.horizontalAlignment ?? we.Center, i = o.alignItems ?? e.verticalAlignment ?? we.Center, c = o.flexDirection ?? "row", d = o.gap ?? e.gap ?? Rn, a = n ? "nowrap" : o.flexWrap ?? e.flexWrap ?? "nowrap", r = o.alignContent ?? e.alignContent ?? void 0, l = /* @__PURE__ */ new Set([
|
|
874
885
|
"justifyContent",
|
|
875
886
|
"alignItems",
|
|
876
887
|
"flexDirection",
|
|
@@ -878,26 +889,26 @@ function Ln({
|
|
|
878
889
|
"flexWrap",
|
|
879
890
|
"alignContent",
|
|
880
891
|
"display"
|
|
881
|
-
]),
|
|
892
|
+
]), f = {};
|
|
882
893
|
for (const [h, g] of Object.entries(o))
|
|
883
|
-
l.has(h) || (
|
|
894
|
+
l.has(h) || (f[h] = g);
|
|
884
895
|
const u = {
|
|
885
896
|
display: "flex",
|
|
886
897
|
flexDirection: c,
|
|
887
|
-
gap:
|
|
898
|
+
gap: d,
|
|
888
899
|
flexWrap: a,
|
|
889
900
|
justifyContent: s,
|
|
890
901
|
alignItems: i,
|
|
891
|
-
...
|
|
902
|
+
...f
|
|
892
903
|
};
|
|
893
904
|
return r !== void 0 && (u.alignContent = r), u;
|
|
894
905
|
}
|
|
895
|
-
const
|
|
906
|
+
const pe = "css-classes-3-resolutions", Wn = 500, On = /[\x00-\x1f\x7f]/g, fe = (e) => {
|
|
896
907
|
if (typeof e != "string")
|
|
897
908
|
return;
|
|
898
909
|
const t = /* @__PURE__ */ new Set(), n = [];
|
|
899
910
|
for (const s of e.split(/\s+/)) {
|
|
900
|
-
const i = s.replace(
|
|
911
|
+
const i = s.replace(On, "");
|
|
901
912
|
i && (t.has(i) || (t.add(i), n.push(i)));
|
|
902
913
|
}
|
|
903
914
|
if (!n.length)
|
|
@@ -905,12 +916,12 @@ const ue = "css-classes-3-resolutions", Mn = 500, Nn = /[\x00-\x1f\x7f]/g, de =
|
|
|
905
916
|
let o = "";
|
|
906
917
|
for (const s of n) {
|
|
907
918
|
const i = o ? `${o} ${s}` : s;
|
|
908
|
-
if (i.length >
|
|
919
|
+
if (i.length > Wn)
|
|
909
920
|
break;
|
|
910
921
|
o = i;
|
|
911
922
|
}
|
|
912
923
|
return o.length ? o : void 0;
|
|
913
|
-
},
|
|
924
|
+
}, je = "hide-component-3-resolutions", jn = [
|
|
914
925
|
"width-3-resolutions",
|
|
915
926
|
"min-width-3-resolutions",
|
|
916
927
|
"max-width-3-resolutions",
|
|
@@ -925,22 +936,22 @@ const ue = "css-classes-3-resolutions", Mn = 500, Nn = /[\x00-\x1f\x7f]/g, de =
|
|
|
925
936
|
"overflow-3-resolutions",
|
|
926
937
|
"overflow-x-3-resolutions",
|
|
927
938
|
"overflow-y-3-resolutions",
|
|
928
|
-
|
|
929
|
-
],
|
|
930
|
-
|
|
939
|
+
je
|
|
940
|
+
], Bn = new Set(
|
|
941
|
+
jn
|
|
931
942
|
);
|
|
932
|
-
function
|
|
943
|
+
function Fn({
|
|
933
944
|
containerAttributes: e,
|
|
934
945
|
deviceDisplayType: t
|
|
935
946
|
}) {
|
|
936
947
|
var o;
|
|
937
|
-
const n =
|
|
948
|
+
const n = O({
|
|
938
949
|
deviceDisplayType: t,
|
|
939
950
|
componentAttributes: e
|
|
940
951
|
});
|
|
941
|
-
return ((o = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : o[
|
|
952
|
+
return ((o = n == null ? void 0 : n.componentAttributesSpecificToDeviceType) == null ? void 0 : o[je]) === "true";
|
|
942
953
|
}
|
|
943
|
-
function
|
|
954
|
+
function Vn({
|
|
944
955
|
containerAttributes: e,
|
|
945
956
|
deviceDisplayType: t,
|
|
946
957
|
isComposeMode: n
|
|
@@ -950,24 +961,24 @@ function jn({
|
|
|
950
961
|
return { styles: {} };
|
|
951
962
|
const o = n ? Object.fromEntries(
|
|
952
963
|
Object.entries(e).filter(
|
|
953
|
-
([c]) => !
|
|
964
|
+
([c]) => !Bn.has(c)
|
|
954
965
|
)
|
|
955
|
-
) : e, s =
|
|
966
|
+
) : e, s = O({
|
|
956
967
|
deviceDisplayType: t,
|
|
957
968
|
componentAttributes: o
|
|
958
969
|
});
|
|
959
970
|
return {
|
|
960
971
|
styles: (s == null ? void 0 : s.styles) ?? {},
|
|
961
|
-
cssClasses:
|
|
962
|
-
(i = s == null ? void 0 : s.componentAttributesSpecificToDeviceType) == null ? void 0 : i[
|
|
972
|
+
cssClasses: fe(
|
|
973
|
+
(i = s == null ? void 0 : s.componentAttributesSpecificToDeviceType) == null ? void 0 : i[pe]
|
|
963
974
|
)
|
|
964
975
|
};
|
|
965
976
|
}
|
|
966
|
-
function
|
|
977
|
+
function _n(e) {
|
|
967
978
|
return Object.keys(e.styles).length > 0 || !!e.cssClasses;
|
|
968
979
|
}
|
|
969
|
-
const
|
|
970
|
-
function
|
|
980
|
+
const me = "/";
|
|
981
|
+
function Kn({
|
|
971
982
|
componentProps: e,
|
|
972
983
|
ancestorColumnIds: t,
|
|
973
984
|
columnId: n
|
|
@@ -976,40 +987,40 @@ function Fn({
|
|
|
976
987
|
return;
|
|
977
988
|
const o = [...t ?? [], n];
|
|
978
989
|
for (let s = 0; s < o.length; s += 1) {
|
|
979
|
-
const i = o.slice(s).join(
|
|
990
|
+
const i = o.slice(s).join(me), c = e[i];
|
|
980
991
|
if (c)
|
|
981
992
|
return c;
|
|
982
993
|
}
|
|
983
994
|
}
|
|
984
|
-
function
|
|
995
|
+
function Un({
|
|
985
996
|
displayItemList: e,
|
|
986
997
|
widgetCollections: t
|
|
987
998
|
}) {
|
|
988
999
|
const n = [], o = (s, i) => {
|
|
989
1000
|
var c;
|
|
990
1001
|
if ((c = s == null ? void 0 : s.rows) != null && c.length)
|
|
991
|
-
for (const
|
|
992
|
-
for (const a of
|
|
993
|
-
if (!a.id || a.type ===
|
|
1002
|
+
for (const d of s.rows)
|
|
1003
|
+
for (const a of d.columns) {
|
|
1004
|
+
if (!a.id || a.type === re.DroppableBox)
|
|
994
1005
|
continue;
|
|
995
|
-
const r =
|
|
1006
|
+
const r = Le(a.type);
|
|
996
1007
|
if (r != null && r.length) {
|
|
997
1008
|
const l = a.collection ?? (t == null ? void 0 : t[r]);
|
|
998
1009
|
l && !i.includes(a.id) && o(l.collectionRows, [...i, a.id]);
|
|
999
1010
|
continue;
|
|
1000
1011
|
}
|
|
1001
1012
|
n.push(
|
|
1002
|
-
[...i, a.id].join(
|
|
1013
|
+
[...i, a.id].join(me)
|
|
1003
1014
|
);
|
|
1004
1015
|
}
|
|
1005
1016
|
};
|
|
1006
1017
|
return o(e, []), n;
|
|
1007
1018
|
}
|
|
1008
|
-
function
|
|
1009
|
-
const n = `${
|
|
1019
|
+
function Hn(e, t) {
|
|
1020
|
+
const n = `${me}${e}`;
|
|
1010
1021
|
return t.some((o) => o === e || o.endsWith(n));
|
|
1011
1022
|
}
|
|
1012
|
-
function
|
|
1023
|
+
function Gn({
|
|
1013
1024
|
componentProps: e,
|
|
1014
1025
|
displayItemList: t,
|
|
1015
1026
|
widgetCollections: n
|
|
@@ -1017,13 +1028,13 @@ function Un({
|
|
|
1017
1028
|
const o = e ? Object.keys(e) : [];
|
|
1018
1029
|
if (!o.length)
|
|
1019
1030
|
return [];
|
|
1020
|
-
const s =
|
|
1031
|
+
const s = Un({
|
|
1021
1032
|
displayItemList: t,
|
|
1022
1033
|
widgetCollections: n
|
|
1023
1034
|
});
|
|
1024
|
-
return o.filter((i) => !
|
|
1035
|
+
return o.filter((i) => !Hn(i, s));
|
|
1025
1036
|
}
|
|
1026
|
-
function
|
|
1037
|
+
function zn({
|
|
1027
1038
|
componentProps: e,
|
|
1028
1039
|
displayItemList: t,
|
|
1029
1040
|
widgetCollections: n,
|
|
@@ -1031,7 +1042,7 @@ function Hn({
|
|
|
1031
1042
|
}) {
|
|
1032
1043
|
if (process.env.NODE_ENV === "production")
|
|
1033
1044
|
return;
|
|
1034
|
-
const s =
|
|
1045
|
+
const s = Gn({
|
|
1035
1046
|
componentProps: e,
|
|
1036
1047
|
displayItemList: t,
|
|
1037
1048
|
widgetCollections: n
|
|
@@ -1040,63 +1051,63 @@ function Hn({
|
|
|
1040
1051
|
`RuleCMSWidget "${o}": componentProps ${s.map((i) => `"${i}"`).join(", ")} ${s.length === 1 ? "matches" : "match"} no component in this widget, so those props were not passed to anything. Keys are column ids from the widget config — the composer's Modify drawer shows the id of the selected component.`
|
|
1041
1052
|
);
|
|
1042
1053
|
}
|
|
1043
|
-
function
|
|
1054
|
+
function Yn(e) {
|
|
1044
1055
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
1045
1056
|
}
|
|
1046
|
-
function
|
|
1057
|
+
function qn(e) {
|
|
1047
1058
|
if (e.all !== void 0 && e.all !== null)
|
|
1048
1059
|
return !1;
|
|
1049
1060
|
const t = e.phone, n = e.tablet, o = e.desktop;
|
|
1050
1061
|
return t !== n || t !== o || n !== o;
|
|
1051
1062
|
}
|
|
1052
|
-
function
|
|
1063
|
+
function ve(e) {
|
|
1053
1064
|
var t;
|
|
1054
1065
|
if (!((t = e == null ? void 0 : e.rows) != null && t.length))
|
|
1055
1066
|
return !1;
|
|
1056
1067
|
for (const n of e.rows) {
|
|
1057
|
-
if (
|
|
1068
|
+
if (Ae(n.rowAttributes))
|
|
1058
1069
|
return !0;
|
|
1059
1070
|
for (const o of n.columns)
|
|
1060
|
-
if (
|
|
1071
|
+
if (Ae(G(o)))
|
|
1061
1072
|
return !0;
|
|
1062
1073
|
}
|
|
1063
1074
|
return !1;
|
|
1064
1075
|
}
|
|
1065
|
-
function
|
|
1076
|
+
function Ae(e) {
|
|
1066
1077
|
if (!e)
|
|
1067
1078
|
return !1;
|
|
1068
1079
|
for (const [t, n] of Object.entries(e))
|
|
1069
|
-
if (!(!t.includes("3-resolutions") || !
|
|
1080
|
+
if (!(!t.includes("3-resolutions") || !Yn(n))) {
|
|
1070
1081
|
if (t === "hide-component-3-resolutions") {
|
|
1071
1082
|
const o = n, s = (i) => i === "true" || i === !0;
|
|
1072
1083
|
if (s(o.phone) !== s(o.tablet) || s(o.phone) !== s(o.desktop))
|
|
1073
1084
|
return !0;
|
|
1074
1085
|
continue;
|
|
1075
1086
|
}
|
|
1076
|
-
if (
|
|
1087
|
+
if (qn(n))
|
|
1077
1088
|
return !0;
|
|
1078
1089
|
}
|
|
1079
1090
|
return !1;
|
|
1080
1091
|
}
|
|
1081
|
-
function
|
|
1082
|
-
if (
|
|
1092
|
+
function Xn(e, t) {
|
|
1093
|
+
if (ve(e))
|
|
1083
1094
|
return !0;
|
|
1084
1095
|
for (const n of Object.values(t))
|
|
1085
|
-
if (
|
|
1096
|
+
if (ve(n.collectionRows))
|
|
1086
1097
|
return !0;
|
|
1087
1098
|
return !1;
|
|
1088
1099
|
}
|
|
1089
|
-
const
|
|
1090
|
-
function
|
|
1100
|
+
const Be = parseInt(Ne, 10), Fe = parseInt(We, 10), Zn = Be + 1, Jn = Fe + 1;
|
|
1101
|
+
function Qn(e) {
|
|
1091
1102
|
const t = `.${e}-phone`, n = `.${e}-tablet`, o = `.${e}-desktop`;
|
|
1092
1103
|
return `
|
|
1093
1104
|
${t}, ${n}, ${o} { display: none; }
|
|
1094
|
-
@media (max-width: ${
|
|
1095
|
-
@media (min-width: ${
|
|
1096
|
-
@media (min-width: ${
|
|
1105
|
+
@media (max-width: ${Be}px) { ${t} { display: block; } }
|
|
1106
|
+
@media (min-width: ${Zn}px) and (max-width: ${Fe}px) { ${n} { display: block; } }
|
|
1107
|
+
@media (min-width: ${Jn}px) { ${o} { display: block; } }
|
|
1097
1108
|
`.trim();
|
|
1098
1109
|
}
|
|
1099
|
-
function
|
|
1110
|
+
function te(e) {
|
|
1100
1111
|
if (!e)
|
|
1101
1112
|
throw new Error("Source components plugin is required, but no plugins were provided");
|
|
1102
1113
|
const t = e.sourceComponents;
|
|
@@ -1110,7 +1121,7 @@ function Q(e) {
|
|
|
1110
1121
|
);
|
|
1111
1122
|
return t;
|
|
1112
1123
|
}
|
|
1113
|
-
const
|
|
1124
|
+
const eo = ["hidden"], to = /* @__PURE__ */ D({
|
|
1114
1125
|
__name: "EmbedInVerticalContainer",
|
|
1115
1126
|
props: {
|
|
1116
1127
|
displayItemList: {},
|
|
@@ -1123,59 +1134,59 @@ const Jn = ["hidden"], Qn = /* @__PURE__ */ x({
|
|
|
1123
1134
|
const t = e;
|
|
1124
1135
|
let n = 0;
|
|
1125
1136
|
const o = `rulecms-vc-${++n}`;
|
|
1126
|
-
function s(h, g,
|
|
1127
|
-
const
|
|
1128
|
-
return !!(g != null && g.length) && g.length >
|
|
1137
|
+
function s(h, g, v) {
|
|
1138
|
+
const C = h && !v ? 3 : 1;
|
|
1139
|
+
return !!(g != null && g.length) && g.length > C;
|
|
1129
1140
|
}
|
|
1130
|
-
const i =
|
|
1141
|
+
const i = y(() => {
|
|
1131
1142
|
var g;
|
|
1132
|
-
return (((g = t.displayItemList.containerAttributes) == null ? void 0 : g[
|
|
1143
|
+
return (((g = t.displayItemList.containerAttributes) == null ? void 0 : g[Q]) || []).join(`;
|
|
1133
1144
|
`);
|
|
1134
|
-
}), c =
|
|
1145
|
+
}), c = y(
|
|
1135
1146
|
() => i.value ? `.${o} {
|
|
1136
1147
|
${i.value}
|
|
1137
1148
|
}` : ""
|
|
1138
|
-
),
|
|
1139
|
-
() => !t.isComposeMode &&
|
|
1149
|
+
), d = y(
|
|
1150
|
+
() => !t.isComposeMode && Fn({
|
|
1140
1151
|
containerAttributes: t.displayItemList.containerAttributes,
|
|
1141
1152
|
deviceDisplayType: t.deviceDisplayType
|
|
1142
1153
|
})
|
|
1143
|
-
), a =
|
|
1144
|
-
() =>
|
|
1154
|
+
), a = y(
|
|
1155
|
+
() => Vn({
|
|
1145
1156
|
containerAttributes: t.displayItemList.containerAttributes,
|
|
1146
1157
|
deviceDisplayType: t.deviceDisplayType,
|
|
1147
1158
|
isComposeMode: t.isComposeMode
|
|
1148
1159
|
})
|
|
1149
|
-
), r =
|
|
1150
|
-
var
|
|
1151
|
-
const h = ((
|
|
1160
|
+
), r = y(() => {
|
|
1161
|
+
var v;
|
|
1162
|
+
const h = ((v = t.displayItemList.containerAttributes) == null ? void 0 : v[Q]) || [], g = _n(a.value);
|
|
1152
1163
|
return t.isComposeMode && !t.isWithinCollection || t.showDropContainers || h.length > 0 || g || s(t.isComposeMode, t.displayItemList.rows, t.isWithinCollection);
|
|
1153
|
-
}), l =
|
|
1164
|
+
}), l = y(
|
|
1154
1165
|
() => [i.value ? o : void 0, a.value.cssClasses].filter(Boolean).join(" ")
|
|
1155
|
-
),
|
|
1166
|
+
), f = y(() => {
|
|
1156
1167
|
var g;
|
|
1157
1168
|
return {
|
|
1158
|
-
...(((g = t.displayItemList.containerAttributes) == null ? void 0 : g[
|
|
1169
|
+
...(((g = t.displayItemList.containerAttributes) == null ? void 0 : g[Q]) || []).some((v) => v.toLowerCase().startsWith("height:")) ? {} : { height: t.isWithinCollection ? "auto" : "100%" },
|
|
1159
1170
|
display: "flex",
|
|
1160
1171
|
flexDirection: "column",
|
|
1161
1172
|
...a.value.styles
|
|
1162
1173
|
};
|
|
1163
|
-
}), u =
|
|
1164
|
-
return (h, g) => (m(),
|
|
1165
|
-
hidden:
|
|
1166
|
-
class:
|
|
1167
|
-
style: S(
|
|
1174
|
+
}), u = y(() => r.value ? l.value : ""), p = y(() => d.value ? { display: "none" } : r.value ? f.value : { display: "contents" });
|
|
1175
|
+
return (h, g) => (m(), b("div", {
|
|
1176
|
+
hidden: d.value || void 0,
|
|
1177
|
+
class: F(u.value || void 0),
|
|
1178
|
+
style: S(p.value)
|
|
1168
1179
|
}, [
|
|
1169
|
-
i.value ? (m(), A(
|
|
1170
|
-
default:
|
|
1171
|
-
|
|
1180
|
+
i.value ? (m(), A(R("style"), { key: 0 }, {
|
|
1181
|
+
default: V(() => [
|
|
1182
|
+
ie(Y(c.value), 1)
|
|
1172
1183
|
]),
|
|
1173
1184
|
_: 1
|
|
1174
|
-
})) :
|
|
1175
|
-
|
|
1176
|
-
], 14,
|
|
1185
|
+
})) : W("", !0),
|
|
1186
|
+
se(h.$slots, "default")
|
|
1187
|
+
], 14, eo));
|
|
1177
1188
|
}
|
|
1178
|
-
}),
|
|
1189
|
+
}), no = ["hidden"], oo = /* @__PURE__ */ D({
|
|
1179
1190
|
__name: "EmbedInRow",
|
|
1180
1191
|
props: {
|
|
1181
1192
|
row: {},
|
|
@@ -1186,40 +1197,40 @@ ${i.value}
|
|
|
1186
1197
|
},
|
|
1187
1198
|
setup(e) {
|
|
1188
1199
|
const t = e;
|
|
1189
|
-
function n(r, l,
|
|
1190
|
-
var
|
|
1191
|
-
const u = r && !
|
|
1192
|
-
return !!((
|
|
1200
|
+
function n(r, l, f) {
|
|
1201
|
+
var p;
|
|
1202
|
+
const u = r && !f ? 3 : 1;
|
|
1203
|
+
return !!((p = l == null ? void 0 : l.columns) != null && p.length) && l.columns.length > u;
|
|
1193
1204
|
}
|
|
1194
|
-
const o =
|
|
1195
|
-
() => !t.isComposeMode &&
|
|
1196
|
-
), s =
|
|
1197
|
-
() => t.showDropContainers ||
|
|
1198
|
-
), i =
|
|
1199
|
-
() =>
|
|
1205
|
+
const o = y(
|
|
1206
|
+
() => !t.isComposeMode && Mn({ row: t.row, deviceDisplayType: t.deviceDisplayType })
|
|
1207
|
+
), s = y(
|
|
1208
|
+
() => t.showDropContainers || Ln(t.row) || n(t.isComposeMode, t.row, t.isWithinCollection)
|
|
1209
|
+
), i = y(
|
|
1210
|
+
() => Nn({
|
|
1200
1211
|
row: t.row,
|
|
1201
1212
|
deviceDisplayType: t.deviceDisplayType,
|
|
1202
1213
|
isComposeMode: t.isComposeMode
|
|
1203
1214
|
})
|
|
1204
|
-
), c =
|
|
1215
|
+
), c = y(() => {
|
|
1205
1216
|
var l;
|
|
1206
|
-
const r =
|
|
1217
|
+
const r = O({
|
|
1207
1218
|
deviceDisplayType: t.deviceDisplayType,
|
|
1208
1219
|
componentAttributes: t.row.rowAttributes
|
|
1209
1220
|
});
|
|
1210
|
-
return
|
|
1211
|
-
(l = r == null ? void 0 : r.componentAttributesSpecificToDeviceType) == null ? void 0 : l[
|
|
1221
|
+
return fe(
|
|
1222
|
+
(l = r == null ? void 0 : r.componentAttributesSpecificToDeviceType) == null ? void 0 : l[pe]
|
|
1212
1223
|
) ?? "";
|
|
1213
|
-
}),
|
|
1214
|
-
return (r, l) => (m(),
|
|
1224
|
+
}), d = y(() => s.value ? c.value : ""), a = y(() => o.value ? { display: "none" } : s.value ? i.value : { display: "contents" });
|
|
1225
|
+
return (r, l) => (m(), b("div", {
|
|
1215
1226
|
hidden: o.value || void 0,
|
|
1216
|
-
class:
|
|
1227
|
+
class: F(d.value || void 0),
|
|
1217
1228
|
style: S(a.value)
|
|
1218
1229
|
}, [
|
|
1219
|
-
|
|
1220
|
-
], 14,
|
|
1230
|
+
se(r.$slots, "default")
|
|
1231
|
+
], 14, no));
|
|
1221
1232
|
}
|
|
1222
|
-
}),
|
|
1233
|
+
}), Ve = [
|
|
1223
1234
|
"minWidth",
|
|
1224
1235
|
"maxWidth",
|
|
1225
1236
|
"minHeight",
|
|
@@ -1271,20 +1282,20 @@ ${i.value}
|
|
|
1271
1282
|
"textAlign",
|
|
1272
1283
|
"textDecoration",
|
|
1273
1284
|
"textTransform"
|
|
1274
|
-
],
|
|
1285
|
+
], so = (e) => e != null && e !== "", io = (e) => e ? Ve.reduce(
|
|
1275
1286
|
(t, n) => {
|
|
1276
1287
|
const o = e[n];
|
|
1277
|
-
return
|
|
1288
|
+
return so(o) && (t[n] = o), t;
|
|
1278
1289
|
},
|
|
1279
1290
|
{}
|
|
1280
|
-
) : {},
|
|
1291
|
+
) : {}, ro = (e) => {
|
|
1281
1292
|
if (!e)
|
|
1282
1293
|
return;
|
|
1283
1294
|
const t = { ...e };
|
|
1284
|
-
for (const n of
|
|
1295
|
+
for (const n of Ve)
|
|
1285
1296
|
delete t[n];
|
|
1286
1297
|
return Object.keys(t).length ? t : void 0;
|
|
1287
|
-
},
|
|
1298
|
+
}, lo = (e) => Object.keys(e).length > 0, co = (e, t) => {
|
|
1288
1299
|
const n = (e == null ? void 0 : e.noContainer) ?? !1, o = e == null ? void 0 : e.resolveNoContainer;
|
|
1289
1300
|
if (typeof o != "function")
|
|
1290
1301
|
return n;
|
|
@@ -1302,7 +1313,7 @@ ${i.value}
|
|
|
1302
1313
|
);
|
|
1303
1314
|
}
|
|
1304
1315
|
return n;
|
|
1305
|
-
},
|
|
1316
|
+
}, ao = (e, t) => {
|
|
1306
1317
|
const n = e == null ? void 0 : e.resolveRendersOwnElement;
|
|
1307
1318
|
if (typeof n != "function")
|
|
1308
1319
|
return !1;
|
|
@@ -1320,7 +1331,7 @@ ${i.value}
|
|
|
1320
1331
|
);
|
|
1321
1332
|
}
|
|
1322
1333
|
return !1;
|
|
1323
|
-
},
|
|
1334
|
+
}, uo = /* @__PURE__ */ D({
|
|
1324
1335
|
__name: "DisplayComponent",
|
|
1325
1336
|
props: {
|
|
1326
1337
|
componentType: {},
|
|
@@ -1328,53 +1339,55 @@ ${i.value}
|
|
|
1328
1339
|
componentAttributes: {},
|
|
1329
1340
|
components: {},
|
|
1330
1341
|
styleProps: {},
|
|
1331
|
-
widgetInstanceProps: {}
|
|
1342
|
+
widgetInstanceProps: {},
|
|
1343
|
+
mounts: {}
|
|
1332
1344
|
},
|
|
1333
1345
|
setup(e) {
|
|
1334
|
-
const t = e, n =
|
|
1346
|
+
const t = e, n = y(() => t.components[Te(t.libraryId, t.componentType)]), o = y(() => {
|
|
1335
1347
|
var h;
|
|
1336
|
-
const
|
|
1337
|
-
return
|
|
1348
|
+
const p = (h = n.value) == null ? void 0 : h.card;
|
|
1349
|
+
return p || (console.error(
|
|
1338
1350
|
`DisplayComponent: Component with type ${t.componentType}${t.libraryId ? ` (library "${t.libraryId}")` : ""} not found in components`
|
|
1339
1351
|
), null);
|
|
1340
|
-
}), s =
|
|
1352
|
+
}), s = y(() => ({
|
|
1341
1353
|
componentAttributes: t.componentAttributes,
|
|
1342
1354
|
styleProps: t.styleProps
|
|
1343
|
-
})), i =
|
|
1344
|
-
() => n.value ?
|
|
1345
|
-
), c =
|
|
1346
|
-
() => i.value ?
|
|
1347
|
-
), a =
|
|
1355
|
+
})), i = y(
|
|
1356
|
+
() => n.value ? co(n.value, s.value) : !1
|
|
1357
|
+
), c = y(() => io(t.styleProps)), d = y(
|
|
1358
|
+
() => i.value ? ro(t.styleProps) : t.styleProps
|
|
1359
|
+
), a = y(
|
|
1348
1360
|
() => {
|
|
1349
|
-
var
|
|
1350
|
-
return
|
|
1361
|
+
var p;
|
|
1362
|
+
return fe((p = t.componentAttributes) == null ? void 0 : p[pe]);
|
|
1351
1363
|
}
|
|
1352
|
-
), r =
|
|
1353
|
-
() => !i.value || (n.value ?
|
|
1354
|
-
),
|
|
1364
|
+
), r = y(() => i.value && lo(c.value)), l = y(
|
|
1365
|
+
() => !i.value || (n.value ? ao(n.value, s.value) : !1)
|
|
1366
|
+
), f = y(
|
|
1355
1367
|
() => !r.value && l.value ? a.value : void 0
|
|
1356
|
-
), u =
|
|
1368
|
+
), u = y(() => ({
|
|
1357
1369
|
componentAttributes: t.componentAttributes,
|
|
1358
|
-
styleProps:
|
|
1359
|
-
className:
|
|
1360
|
-
widgetInstanceProps: t.widgetInstanceProps
|
|
1370
|
+
styleProps: d.value,
|
|
1371
|
+
className: f.value,
|
|
1372
|
+
widgetInstanceProps: t.widgetInstanceProps,
|
|
1373
|
+
mounts: t.mounts
|
|
1361
1374
|
}));
|
|
1362
|
-
return (
|
|
1363
|
-
r.value ? (m(),
|
|
1375
|
+
return (p, h) => o.value ? (m(), b(I, { key: 0 }, [
|
|
1376
|
+
r.value ? (m(), b("div", {
|
|
1364
1377
|
key: 0,
|
|
1365
|
-
class:
|
|
1378
|
+
class: F(a.value || void 0),
|
|
1366
1379
|
style: S(c.value)
|
|
1367
1380
|
}, [
|
|
1368
|
-
(m(), A(
|
|
1369
|
-
], 6)) : !l.value && a.value ? (m(),
|
|
1381
|
+
(m(), A(R(o.value), Z(ge(u.value)), null, 16))
|
|
1382
|
+
], 6)) : !l.value && a.value ? (m(), b("div", {
|
|
1370
1383
|
key: 1,
|
|
1371
|
-
class:
|
|
1384
|
+
class: F(a.value)
|
|
1372
1385
|
}, [
|
|
1373
|
-
(m(), A(
|
|
1374
|
-
], 2)) : (m(), A(
|
|
1375
|
-
], 64)) :
|
|
1386
|
+
(m(), A(R(o.value), Z(ge(u.value)), null, 16))
|
|
1387
|
+
], 2)) : (m(), A(R(o.value), Z(qe({ key: 2 }, u.value)), null, 16))
|
|
1388
|
+
], 64)) : W("", !0);
|
|
1376
1389
|
}
|
|
1377
|
-
}),
|
|
1390
|
+
}), po = /* @__PURE__ */ D({
|
|
1378
1391
|
__name: "RenderComponentsInner",
|
|
1379
1392
|
props: {
|
|
1380
1393
|
displayItemList: {},
|
|
@@ -1386,27 +1399,28 @@ ${i.value}
|
|
|
1386
1399
|
plugins: {},
|
|
1387
1400
|
deviceDisplayType: {},
|
|
1388
1401
|
componentProps: {},
|
|
1402
|
+
mounts: {},
|
|
1389
1403
|
ancestorColumnIds: {}
|
|
1390
1404
|
},
|
|
1391
1405
|
setup(e) {
|
|
1392
|
-
const t = e, n = () =>
|
|
1406
|
+
const t = e, n = () => te(t.plugins).components;
|
|
1393
1407
|
function o(a) {
|
|
1394
|
-
if (t.isComposeMode && a.type ===
|
|
1408
|
+
if (t.isComposeMode && a.type === re.DroppableBox)
|
|
1395
1409
|
return !1;
|
|
1396
|
-
const { componentAttributesBasedOnDevice: r } =
|
|
1410
|
+
const { componentAttributesBasedOnDevice: r } = Ce({
|
|
1397
1411
|
col: a,
|
|
1398
1412
|
deviceDisplayType: t.deviceDisplayType,
|
|
1399
1413
|
isComposeMode: t.isComposeMode,
|
|
1400
|
-
sourceComponentsPlugin:
|
|
1414
|
+
sourceComponentsPlugin: te(t.plugins)
|
|
1401
1415
|
}), l = !!r && r["hide-component-3-resolutions"] === "true";
|
|
1402
1416
|
return !(!t.isComposeMode && l);
|
|
1403
1417
|
}
|
|
1404
1418
|
function s(a) {
|
|
1405
|
-
const { componentAttributesBasedOnDevice: r, componentStyles: l } =
|
|
1419
|
+
const { componentAttributesBasedOnDevice: r, componentStyles: l } = Ce({
|
|
1406
1420
|
col: a,
|
|
1407
1421
|
deviceDisplayType: t.deviceDisplayType,
|
|
1408
1422
|
isComposeMode: t.isComposeMode,
|
|
1409
|
-
sourceComponentsPlugin:
|
|
1423
|
+
sourceComponentsPlugin: te(t.plugins)
|
|
1410
1424
|
});
|
|
1411
1425
|
return {
|
|
1412
1426
|
componentAttributes: r,
|
|
@@ -1414,7 +1428,7 @@ ${i.value}
|
|
|
1414
1428
|
};
|
|
1415
1429
|
}
|
|
1416
1430
|
function i(a) {
|
|
1417
|
-
const r =
|
|
1431
|
+
const r = Le(a.type);
|
|
1418
1432
|
if (!(r != null && r.length))
|
|
1419
1433
|
return null;
|
|
1420
1434
|
const l = a.collection ?? t.widgetCollections[r];
|
|
@@ -1422,41 +1436,41 @@ ${i.value}
|
|
|
1422
1436
|
throw new Error(
|
|
1423
1437
|
`DisplayCollection - Collection with ID ${r} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`
|
|
1424
1438
|
);
|
|
1425
|
-
return !l.collectionRows ||
|
|
1439
|
+
return !l.collectionRows || !$n(l.collectionRows) ? null : l.collectionRows;
|
|
1426
1440
|
}
|
|
1427
1441
|
function c(a) {
|
|
1428
1442
|
return [...t.ancestorColumnIds ?? [], a];
|
|
1429
1443
|
}
|
|
1430
|
-
function
|
|
1431
|
-
return
|
|
1444
|
+
function d(a) {
|
|
1445
|
+
return Kn({
|
|
1432
1446
|
componentProps: t.componentProps,
|
|
1433
1447
|
ancestorColumnIds: t.ancestorColumnIds,
|
|
1434
1448
|
columnId: a
|
|
1435
1449
|
});
|
|
1436
1450
|
}
|
|
1437
1451
|
return (a, r) => {
|
|
1438
|
-
const l =
|
|
1439
|
-
return m(), A(
|
|
1452
|
+
const l = Xe("RenderComponentsInner", !0);
|
|
1453
|
+
return m(), A(to, {
|
|
1440
1454
|
"display-item-list": e.displayItemList,
|
|
1441
1455
|
"is-compose-mode": e.isComposeMode,
|
|
1442
1456
|
"show-drop-containers": e.showDropContainers,
|
|
1443
1457
|
"is-within-collection": e.isWithinCollection,
|
|
1444
1458
|
"device-display-type": e.deviceDisplayType
|
|
1445
1459
|
}, {
|
|
1446
|
-
default:
|
|
1447
|
-
(m(!0),
|
|
1448
|
-
key:
|
|
1449
|
-
row:
|
|
1460
|
+
default: V(() => [
|
|
1461
|
+
(m(!0), b(I, null, z(e.displayItemList.rows, (f) => (m(), A(oo, {
|
|
1462
|
+
key: f.id,
|
|
1463
|
+
row: f,
|
|
1450
1464
|
"is-compose-mode": e.isComposeMode,
|
|
1451
1465
|
"show-drop-containers": e.showDropContainers,
|
|
1452
1466
|
"is-within-collection": e.isWithinCollection,
|
|
1453
1467
|
"device-display-type": e.deviceDisplayType
|
|
1454
1468
|
}, {
|
|
1455
|
-
default:
|
|
1456
|
-
(m(!0),
|
|
1469
|
+
default: V(() => [
|
|
1470
|
+
(m(!0), b(I, null, z(f.columns, (u) => (m(), b(I, {
|
|
1457
1471
|
key: u.id
|
|
1458
1472
|
}, [
|
|
1459
|
-
o(u) ? (m(),
|
|
1473
|
+
o(u) ? (m(), b(I, { key: 0 }, [
|
|
1460
1474
|
i(u) ? (m(), A(l, {
|
|
1461
1475
|
key: 0,
|
|
1462
1476
|
"display-item-list": i(u),
|
|
@@ -1468,17 +1482,19 @@ ${i.value}
|
|
|
1468
1482
|
plugins: e.plugins,
|
|
1469
1483
|
"device-display-type": e.deviceDisplayType,
|
|
1470
1484
|
"component-props": e.componentProps,
|
|
1485
|
+
mounts: e.mounts,
|
|
1471
1486
|
"ancestor-column-ids": c(u.id)
|
|
1472
|
-
}, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "ancestor-column-ids"])) : (m(), A(
|
|
1487
|
+
}, null, 8, ["display-item-list", "is-compose-mode", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "ancestor-column-ids"])) : (m(), A(uo, {
|
|
1473
1488
|
key: 1,
|
|
1474
1489
|
"component-type": u.type,
|
|
1475
1490
|
"library-id": u.libraryId,
|
|
1476
1491
|
"component-attributes": s(u).componentAttributes,
|
|
1477
1492
|
components: n(),
|
|
1478
1493
|
"style-props": s(u).styleProps,
|
|
1479
|
-
"widget-instance-props":
|
|
1480
|
-
|
|
1481
|
-
|
|
1494
|
+
"widget-instance-props": d(u.id),
|
|
1495
|
+
mounts: e.mounts
|
|
1496
|
+
}, null, 8, ["component-type", "library-id", "component-attributes", "components", "style-props", "widget-instance-props", "mounts"]))
|
|
1497
|
+
], 64)) : W("", !0)
|
|
1482
1498
|
], 64))), 128))
|
|
1483
1499
|
]),
|
|
1484
1500
|
_: 2
|
|
@@ -1488,7 +1504,7 @@ ${i.value}
|
|
|
1488
1504
|
}, 8, ["display-item-list", "is-compose-mode", "show-drop-containers", "is-within-collection", "device-display-type"]);
|
|
1489
1505
|
};
|
|
1490
1506
|
}
|
|
1491
|
-
}),
|
|
1507
|
+
}), oe = /* @__PURE__ */ D({
|
|
1492
1508
|
__name: "RenderComponentsForDevice",
|
|
1493
1509
|
props: {
|
|
1494
1510
|
displayItemList: {},
|
|
@@ -1500,12 +1516,13 @@ ${i.value}
|
|
|
1500
1516
|
deviceDisplayType: {},
|
|
1501
1517
|
plugins: {},
|
|
1502
1518
|
componentProps: {},
|
|
1519
|
+
mounts: {},
|
|
1503
1520
|
ancestorColumnIds: {}
|
|
1504
1521
|
},
|
|
1505
1522
|
setup(e) {
|
|
1506
1523
|
return (t, n) => {
|
|
1507
1524
|
var o, s;
|
|
1508
|
-
return (s = (o = e.displayItemList) == null ? void 0 : o.rows) != null && s.length ? (m(), A(
|
|
1525
|
+
return (s = (o = e.displayItemList) == null ? void 0 : o.rows) != null && s.length ? (m(), A(po, {
|
|
1509
1526
|
key: 0,
|
|
1510
1527
|
"display-item-list": e.displayItemList,
|
|
1511
1528
|
"is-compose-mode": e.isComposeMode,
|
|
@@ -1516,63 +1533,91 @@ ${i.value}
|
|
|
1516
1533
|
plugins: e.plugins,
|
|
1517
1534
|
"device-display-type": e.deviceDisplayType,
|
|
1518
1535
|
"component-props": e.componentProps,
|
|
1536
|
+
mounts: e.mounts,
|
|
1519
1537
|
"ancestor-column-ids": e.ancestorColumnIds
|
|
1520
|
-
}, null, 8, ["display-item-list", "is-compose-mode", "is-within-collection", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "ancestor-column-ids"])) :
|
|
1538
|
+
}, null, 8, ["display-item-list", "is-compose-mode", "is-within-collection", "widget-collections", "show-drop-containers", "redux-device-display-type", "plugins", "device-display-type", "component-props", "mounts", "ancestor-column-ids"])) : W("", !0);
|
|
1521
1539
|
};
|
|
1522
1540
|
}
|
|
1523
|
-
}),
|
|
1541
|
+
}), _e = /* @__PURE__ */ D({
|
|
1542
|
+
__name: "LibraryStylesheets",
|
|
1543
|
+
props: {
|
|
1544
|
+
stylesheets: {}
|
|
1545
|
+
},
|
|
1546
|
+
setup(e) {
|
|
1547
|
+
return (t, n) => (m(!0), b(I, null, z(e.stylesheets ?? [], (o) => (m(), A(R("style"), {
|
|
1548
|
+
key: o,
|
|
1549
|
+
"data-rulecms-library-stylesheet": ""
|
|
1550
|
+
}, {
|
|
1551
|
+
default: V(() => [
|
|
1552
|
+
ie(Y(o), 1)
|
|
1553
|
+
]),
|
|
1554
|
+
_: 2
|
|
1555
|
+
}, 1024))), 128));
|
|
1556
|
+
}
|
|
1557
|
+
}), fo = /* @__PURE__ */ D({
|
|
1524
1558
|
__name: "BreakpointVariantRender",
|
|
1525
1559
|
props: {
|
|
1526
1560
|
displayItemList: {},
|
|
1527
1561
|
widgetCollections: {},
|
|
1528
1562
|
plugins: {},
|
|
1529
1563
|
componentProps: {},
|
|
1564
|
+
mounts: {},
|
|
1530
1565
|
scopeIdInput: {}
|
|
1531
1566
|
},
|
|
1532
1567
|
setup(e) {
|
|
1533
1568
|
const t = ["Phone", "Tablet", "Desktop"];
|
|
1534
1569
|
let n = 0;
|
|
1535
|
-
const o = e, s = `rulecms-bp-${++n}`, i =
|
|
1536
|
-
() =>
|
|
1537
|
-
),
|
|
1538
|
-
return (a, r) =>
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1570
|
+
const o = e, s = `rulecms-bp-${++n}`, i = y(() => o.scopeIdInput ?? s), c = y(
|
|
1571
|
+
() => Xn(o.displayItemList, o.widgetCollections)
|
|
1572
|
+
), d = y(() => Qn(i.value));
|
|
1573
|
+
return (a, r) => {
|
|
1574
|
+
var l;
|
|
1575
|
+
return m(), b(I, null, [
|
|
1576
|
+
ne(_e, {
|
|
1577
|
+
stylesheets: (l = e.plugins.sourceComponents) == null ? void 0 : l.stylesheets
|
|
1578
|
+
}, null, 8, ["stylesheets"]),
|
|
1579
|
+
c.value ? (m(), b(I, { key: 1 }, [
|
|
1580
|
+
(m(), A(R("style"), null, {
|
|
1581
|
+
default: V(() => [
|
|
1582
|
+
ie(Y(d.value), 1)
|
|
1583
|
+
]),
|
|
1584
|
+
_: 1
|
|
1585
|
+
})),
|
|
1586
|
+
(m(), b(I, null, z(t, (f) => $("div", {
|
|
1587
|
+
key: f,
|
|
1588
|
+
class: F(`${i.value}-${f.toLowerCase()}`)
|
|
1589
|
+
}, [
|
|
1590
|
+
ne(oe, {
|
|
1591
|
+
"display-item-list": e.displayItemList,
|
|
1592
|
+
"is-compose-mode": !1,
|
|
1593
|
+
"is-within-collection": !1,
|
|
1594
|
+
"widget-collections": e.widgetCollections,
|
|
1595
|
+
"show-drop-containers": !1,
|
|
1596
|
+
"redux-device-display-type": "desktop",
|
|
1597
|
+
"device-display-type": f,
|
|
1598
|
+
plugins: e.plugins,
|
|
1599
|
+
"component-props": e.componentProps,
|
|
1600
|
+
mounts: e.mounts
|
|
1601
|
+
}, null, 8, ["display-item-list", "widget-collections", "device-display-type", "plugins", "component-props", "mounts"])
|
|
1602
|
+
], 2)), 64))
|
|
1603
|
+
], 64)) : (m(), A(oe, {
|
|
1604
|
+
key: 0,
|
|
1550
1605
|
"display-item-list": e.displayItemList,
|
|
1551
1606
|
"is-compose-mode": !1,
|
|
1552
1607
|
"is-within-collection": !1,
|
|
1553
1608
|
"widget-collections": e.widgetCollections,
|
|
1554
1609
|
"show-drop-containers": !1,
|
|
1555
1610
|
"redux-device-display-type": "desktop",
|
|
1556
|
-
"device-display-type":
|
|
1611
|
+
"device-display-type": "Desktop",
|
|
1557
1612
|
plugins: e.plugins,
|
|
1558
|
-
"component-props": e.componentProps
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
"display-item-list": e.displayItemList,
|
|
1564
|
-
"is-compose-mode": !1,
|
|
1565
|
-
"is-within-collection": !1,
|
|
1566
|
-
"widget-collections": e.widgetCollections,
|
|
1567
|
-
"show-drop-containers": !1,
|
|
1568
|
-
"redux-device-display-type": "desktop",
|
|
1569
|
-
"device-display-type": "Desktop",
|
|
1570
|
-
plugins: e.plugins,
|
|
1571
|
-
"component-props": e.componentProps
|
|
1572
|
-
}, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props"]));
|
|
1613
|
+
"component-props": e.componentProps,
|
|
1614
|
+
mounts: e.mounts
|
|
1615
|
+
}, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts"]))
|
|
1616
|
+
], 64);
|
|
1617
|
+
};
|
|
1573
1618
|
}
|
|
1574
1619
|
});
|
|
1575
|
-
function
|
|
1620
|
+
function mo(e, t, n) {
|
|
1576
1621
|
if (e)
|
|
1577
1622
|
return "Phone";
|
|
1578
1623
|
if (t)
|
|
@@ -1580,7 +1625,7 @@ function po(e, t, n) {
|
|
|
1580
1625
|
const o = (n == null ? void 0 : n.toLowerCase()) || "desktop";
|
|
1581
1626
|
return o === "phone" ? "Phone" : o === "tablet" ? "Tablet" : "Desktop";
|
|
1582
1627
|
}
|
|
1583
|
-
const
|
|
1628
|
+
const yo = `(max-width: ${Ne})`, go = `(max-width: ${We})`, ho = /* @__PURE__ */ D({
|
|
1584
1629
|
__name: "RenderComponents",
|
|
1585
1630
|
props: {
|
|
1586
1631
|
displayItemList: {},
|
|
@@ -1590,36 +1635,47 @@ const fo = `(max-width: ${Me})`, yo = `(max-width: ${Ne})`, mo = /* @__PURE__ */
|
|
|
1590
1635
|
showDropContainers: { type: Boolean },
|
|
1591
1636
|
reduxDeviceDisplayType: {},
|
|
1592
1637
|
plugins: {},
|
|
1593
|
-
componentProps: {}
|
|
1638
|
+
componentProps: {},
|
|
1639
|
+
mounts: {}
|
|
1594
1640
|
},
|
|
1595
1641
|
setup(e) {
|
|
1596
|
-
const t = e, n =
|
|
1642
|
+
const t = e, n = B("Desktop");
|
|
1597
1643
|
let o, s;
|
|
1598
1644
|
function i() {
|
|
1599
|
-
n.value =
|
|
1645
|
+
n.value = mo(
|
|
1600
1646
|
(o == null ? void 0 : o.matches) ?? !1,
|
|
1601
1647
|
(s == null ? void 0 : s.matches) ?? !1,
|
|
1602
1648
|
t.reduxDeviceDisplayType
|
|
1603
1649
|
);
|
|
1604
1650
|
}
|
|
1605
|
-
return
|
|
1606
|
-
typeof matchMedia == "function" && (o = matchMedia(
|
|
1607
|
-
}),
|
|
1651
|
+
return Ze(() => {
|
|
1652
|
+
typeof matchMedia == "function" && (o = matchMedia(yo), s = matchMedia(go), o.addEventListener("change", i), s.addEventListener("change", i)), i();
|
|
1653
|
+
}), xe(() => {
|
|
1608
1654
|
o == null || o.removeEventListener("change", i), s == null || s.removeEventListener("change", i);
|
|
1609
|
-
}), (c,
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1655
|
+
}), (c, d) => {
|
|
1656
|
+
var a;
|
|
1657
|
+
return m(), b(I, null, [
|
|
1658
|
+
e.isWithinCollection ? W("", !0) : (m(), A(_e, {
|
|
1659
|
+
key: 0,
|
|
1660
|
+
stylesheets: (a = e.plugins.sourceComponents) == null ? void 0 : a.stylesheets
|
|
1661
|
+
}, null, 8, ["stylesheets"])),
|
|
1662
|
+
ne(oe, {
|
|
1663
|
+
"display-item-list": e.displayItemList,
|
|
1664
|
+
"is-compose-mode": e.isComposeMode,
|
|
1665
|
+
"is-within-collection": e.isWithinCollection,
|
|
1666
|
+
"widget-collections": e.widgetCollections,
|
|
1667
|
+
"show-drop-containers": e.showDropContainers,
|
|
1668
|
+
"redux-device-display-type": e.reduxDeviceDisplayType,
|
|
1669
|
+
"device-display-type": n.value,
|
|
1670
|
+
plugins: e.plugins,
|
|
1671
|
+
"component-props": e.componentProps,
|
|
1672
|
+
mounts: e.mounts
|
|
1673
|
+
}, null, 8, ["display-item-list", "is-compose-mode", "is-within-collection", "widget-collections", "show-drop-containers", "redux-device-display-type", "device-display-type", "plugins", "component-props", "mounts"])
|
|
1674
|
+
], 64);
|
|
1675
|
+
};
|
|
1620
1676
|
}
|
|
1621
1677
|
});
|
|
1622
|
-
function
|
|
1678
|
+
function bo(e) {
|
|
1623
1679
|
const t = {};
|
|
1624
1680
|
return Object.entries(e).forEach(([n, o]) => {
|
|
1625
1681
|
const s = { ...o };
|
|
@@ -1633,62 +1689,62 @@ function go(e) {
|
|
|
1633
1689
|
s.parentId && (i = `${i}@${s.parentId}`), t[i] = s;
|
|
1634
1690
|
}), t;
|
|
1635
1691
|
}
|
|
1636
|
-
function
|
|
1692
|
+
function wo(e) {
|
|
1637
1693
|
return typeof e.itemList == "string" ? JSON.parse(e.itemList) : e.itemList;
|
|
1638
1694
|
}
|
|
1639
|
-
function
|
|
1695
|
+
function Ke(e) {
|
|
1640
1696
|
return {
|
|
1641
|
-
displayItemList:
|
|
1642
|
-
widgetCollections:
|
|
1697
|
+
displayItemList: wo(e.widget),
|
|
1698
|
+
widgetCollections: bo(e.childCollections),
|
|
1643
1699
|
...e.libraries ? { libraries: e.libraries } : {}
|
|
1644
1700
|
};
|
|
1645
1701
|
}
|
|
1646
|
-
function
|
|
1647
|
-
const t = e.registry ??
|
|
1702
|
+
function Co(e) {
|
|
1703
|
+
const t = e.registry ?? q(), n = le({
|
|
1648
1704
|
displayItemList: e.displayItemList,
|
|
1649
1705
|
widgetCollections: e.widgetCollections
|
|
1650
1706
|
});
|
|
1651
1707
|
return t.resolveSync({ registrations: e.libraries, referenced: n });
|
|
1652
1708
|
}
|
|
1653
|
-
function
|
|
1654
|
-
const t = e.registry ??
|
|
1709
|
+
function vo(e) {
|
|
1710
|
+
const t = e.registry ?? q(), n = le({
|
|
1655
1711
|
displayItemList: e.displayItemList,
|
|
1656
1712
|
widgetCollections: e.widgetCollections
|
|
1657
1713
|
});
|
|
1658
1714
|
return t.resolve({ registrations: e.libraries, referenced: n });
|
|
1659
1715
|
}
|
|
1660
|
-
const
|
|
1716
|
+
const Ao = {
|
|
1661
1717
|
display: "flex",
|
|
1662
1718
|
justifyContent: "center",
|
|
1663
1719
|
alignItems: "center",
|
|
1664
1720
|
padding: "3rem",
|
|
1665
1721
|
color: "#e2e8f0"
|
|
1666
|
-
},
|
|
1722
|
+
}, So = {
|
|
1667
1723
|
display: "flex",
|
|
1668
1724
|
alignItems: "center",
|
|
1669
1725
|
gap: "1rem"
|
|
1670
|
-
},
|
|
1726
|
+
}, Io = {
|
|
1671
1727
|
width: "40px",
|
|
1672
1728
|
height: "40px",
|
|
1673
1729
|
border: "4px solid #4a5568",
|
|
1674
1730
|
borderTopColor: "#63b3ed",
|
|
1675
1731
|
borderRadius: "50%",
|
|
1676
1732
|
animation: "spin 1s linear infinite"
|
|
1677
|
-
},
|
|
1733
|
+
}, Se = {
|
|
1678
1734
|
padding: "1.5rem",
|
|
1679
1735
|
backgroundColor: "#742a2a",
|
|
1680
1736
|
border: "1px solid #9b2c2c",
|
|
1681
1737
|
borderRadius: "8px",
|
|
1682
1738
|
color: "#fed7d7"
|
|
1683
|
-
},
|
|
1739
|
+
}, Ie = {
|
|
1684
1740
|
fontSize: "16px",
|
|
1685
1741
|
fontWeight: "600",
|
|
1686
1742
|
marginBottom: "0.5rem",
|
|
1687
1743
|
color: "#feb2b2"
|
|
1688
|
-
},
|
|
1744
|
+
}, ke = {
|
|
1689
1745
|
fontSize: "14px",
|
|
1690
1746
|
color: "#fed7d7"
|
|
1691
|
-
},
|
|
1747
|
+
}, ko = `
|
|
1692
1748
|
@keyframes spin {
|
|
1693
1749
|
from {
|
|
1694
1750
|
transform: rotate(0deg);
|
|
@@ -1697,7 +1753,7 @@ const Co = {
|
|
|
1697
1753
|
transform: rotate(360deg);
|
|
1698
1754
|
}
|
|
1699
1755
|
}
|
|
1700
|
-
`,
|
|
1756
|
+
`, Ko = "data-rulecms-published-key", Do = ["data-rulecms-published-key"], Uo = /* @__PURE__ */ D({
|
|
1701
1757
|
__name: "RuleCMSWidget",
|
|
1702
1758
|
props: {
|
|
1703
1759
|
publishedKey: {},
|
|
@@ -1706,39 +1762,40 @@ const Co = {
|
|
|
1706
1762
|
mode: { default: "client-fetch" },
|
|
1707
1763
|
initialData: {},
|
|
1708
1764
|
libraries: {},
|
|
1709
|
-
componentProps: {}
|
|
1765
|
+
componentProps: {},
|
|
1766
|
+
mounts: {}
|
|
1710
1767
|
},
|
|
1711
1768
|
setup(e) {
|
|
1712
|
-
const t = e, n =
|
|
1769
|
+
const t = e, n = Je(Me, null), o = B(!1), s = B(null), i = B(null), c = B(null), d = y(() => t.mode === "pre-fetched"), a = y(() => ({
|
|
1713
1770
|
sourceComponents: c.value ?? void 0
|
|
1714
1771
|
}));
|
|
1715
|
-
let r = null, l = null,
|
|
1772
|
+
let r = null, l = null, f = !1;
|
|
1716
1773
|
function u() {
|
|
1717
1774
|
if (!i.value) {
|
|
1718
1775
|
c.value = null;
|
|
1719
1776
|
return;
|
|
1720
1777
|
}
|
|
1721
|
-
const
|
|
1778
|
+
const C = t.libraries ?? (n == null ? void 0 : n.libraries), x = n == null ? void 0 : n.libraryRegistry, j = Co({
|
|
1722
1779
|
displayItemList: i.value.displayItemList,
|
|
1723
1780
|
widgetCollections: i.value.widgetCollections,
|
|
1724
|
-
libraries:
|
|
1725
|
-
registry:
|
|
1781
|
+
libraries: C,
|
|
1782
|
+
registry: x
|
|
1726
1783
|
});
|
|
1727
|
-
if (
|
|
1728
|
-
c.value =
|
|
1784
|
+
if (j) {
|
|
1785
|
+
c.value = j;
|
|
1729
1786
|
return;
|
|
1730
1787
|
}
|
|
1731
|
-
|
|
1788
|
+
vo({
|
|
1732
1789
|
displayItemList: i.value.displayItemList,
|
|
1733
1790
|
widgetCollections: i.value.widgetCollections,
|
|
1734
|
-
libraries:
|
|
1735
|
-
registry:
|
|
1736
|
-
}).then((
|
|
1737
|
-
c.value =
|
|
1791
|
+
libraries: C,
|
|
1792
|
+
registry: x
|
|
1793
|
+
}).then((X) => {
|
|
1794
|
+
c.value = X;
|
|
1738
1795
|
});
|
|
1739
1796
|
}
|
|
1740
|
-
function
|
|
1741
|
-
i.value &&
|
|
1797
|
+
function p() {
|
|
1798
|
+
i.value && zn({
|
|
1742
1799
|
componentProps: t.componentProps,
|
|
1743
1800
|
displayItemList: i.value.displayItemList,
|
|
1744
1801
|
widgetCollections: i.value.widgetCollections,
|
|
@@ -1746,57 +1803,57 @@ const Co = {
|
|
|
1746
1803
|
});
|
|
1747
1804
|
}
|
|
1748
1805
|
function h() {
|
|
1749
|
-
if (
|
|
1806
|
+
if (f || typeof document > "u")
|
|
1750
1807
|
return;
|
|
1751
|
-
const
|
|
1752
|
-
if (!document.getElementById(
|
|
1753
|
-
const
|
|
1754
|
-
|
|
1808
|
+
const C = "rulecms-widget-spinner-styles";
|
|
1809
|
+
if (!document.getElementById(C)) {
|
|
1810
|
+
const x = document.createElement("style");
|
|
1811
|
+
x.id = C, x.textContent = ko, document.head.appendChild(x);
|
|
1755
1812
|
}
|
|
1756
|
-
|
|
1813
|
+
f = !0;
|
|
1757
1814
|
}
|
|
1758
1815
|
function g() {
|
|
1759
|
-
const
|
|
1760
|
-
if (!t.publishedKey || !
|
|
1761
|
-
s.value = t.publishedKey ? "Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider." :
|
|
1816
|
+
const C = t.token ?? (n == null ? void 0 : n.token), x = t.endpoint ?? (n == null ? void 0 : n.endpoint);
|
|
1817
|
+
if (!t.publishedKey || !C) {
|
|
1818
|
+
s.value = t.publishedKey ? "Token is required. Provide it either directly as a prop (`token`) or via RuleCMSWidgetProvider." : L(C) ? "Widget key is required" : "Published key is required", i.value = null;
|
|
1762
1819
|
return;
|
|
1763
1820
|
}
|
|
1764
|
-
const
|
|
1765
|
-
if (l ===
|
|
1821
|
+
const j = `${t.publishedKey}|${C}`;
|
|
1822
|
+
if (l === j && i.value) {
|
|
1766
1823
|
u();
|
|
1767
1824
|
return;
|
|
1768
1825
|
}
|
|
1769
1826
|
r == null || r.abort(), r = new AbortController();
|
|
1770
|
-
const
|
|
1771
|
-
l =
|
|
1772
|
-
const
|
|
1773
|
-
fetch(
|
|
1827
|
+
const X = r.signal;
|
|
1828
|
+
l = j, o.value = !0, s.value = null;
|
|
1829
|
+
const Ue = $e({ publishedKey: t.publishedKey, token: C, endpoint: x });
|
|
1830
|
+
fetch(Ue, {
|
|
1774
1831
|
method: "GET",
|
|
1775
1832
|
headers: { "Content-Type": "application/json" },
|
|
1776
|
-
...
|
|
1777
|
-
signal:
|
|
1778
|
-
}).then(async (
|
|
1779
|
-
if (
|
|
1780
|
-
const
|
|
1781
|
-
|
|
1833
|
+
...L(C) ? { cache: "no-store" } : {},
|
|
1834
|
+
signal: X
|
|
1835
|
+
}).then(async (E) => {
|
|
1836
|
+
if (E.ok) {
|
|
1837
|
+
const K = await E.json();
|
|
1838
|
+
K.success ? (i.value = Ke(K.data), s.value = null, u(), p()) : (s.value = "Failed to fetch widget data", i.value = null);
|
|
1782
1839
|
} else {
|
|
1783
|
-
const
|
|
1784
|
-
s.value =
|
|
1840
|
+
const K = await E.json().catch(() => ({ error: "Unknown error" }));
|
|
1841
|
+
s.value = K.error || `Request failed with status ${E.status}`, i.value = null;
|
|
1785
1842
|
}
|
|
1786
|
-
}).catch((
|
|
1787
|
-
|
|
1843
|
+
}).catch((E) => {
|
|
1844
|
+
E instanceof DOMException && E.name === "AbortError" || (console.error("Error fetching widget:", E), s.value = "Failed to fetch widget", i.value = null);
|
|
1788
1845
|
}).finally(() => {
|
|
1789
1846
|
o.value = !1;
|
|
1790
1847
|
});
|
|
1791
1848
|
}
|
|
1792
|
-
function
|
|
1849
|
+
function v() {
|
|
1793
1850
|
if (t.mode === "pre-fetched") {
|
|
1794
|
-
i.value = t.initialData ?? null, o.value = !1, s.value = null, u(),
|
|
1851
|
+
i.value = t.initialData ?? null, o.value = !1, s.value = null, u(), p();
|
|
1795
1852
|
return;
|
|
1796
1853
|
}
|
|
1797
1854
|
h(), g();
|
|
1798
1855
|
}
|
|
1799
|
-
return
|
|
1856
|
+
return De(
|
|
1800
1857
|
() => [
|
|
1801
1858
|
t.publishedKey,
|
|
1802
1859
|
t.token,
|
|
@@ -1807,54 +1864,55 @@ const Co = {
|
|
|
1807
1864
|
t.componentProps
|
|
1808
1865
|
],
|
|
1809
1866
|
() => {
|
|
1810
|
-
|
|
1867
|
+
v();
|
|
1811
1868
|
},
|
|
1812
1869
|
{ immediate: !0 }
|
|
1813
|
-
),
|
|
1870
|
+
), xe(() => {
|
|
1814
1871
|
r == null || r.abort();
|
|
1815
|
-
}), (
|
|
1872
|
+
}), (C, x) => (m(), b("span", {
|
|
1816
1873
|
"data-rulecms-published-key": e.publishedKey,
|
|
1817
1874
|
style: { display: "contents" }
|
|
1818
1875
|
}, [
|
|
1819
|
-
e.mode !== "pre-fetched" && o.value ? (m(),
|
|
1876
|
+
e.mode !== "pre-fetched" && o.value ? (m(), b("div", {
|
|
1820
1877
|
key: 0,
|
|
1821
|
-
style: S(
|
|
1878
|
+
style: S(T(Ao))
|
|
1822
1879
|
}, [
|
|
1823
1880
|
$("div", {
|
|
1824
|
-
style: S(
|
|
1881
|
+
style: S(T(So))
|
|
1825
1882
|
}, [
|
|
1826
1883
|
$("div", {
|
|
1827
|
-
style: S(
|
|
1884
|
+
style: S(T(Io))
|
|
1828
1885
|
}, null, 4)
|
|
1829
1886
|
], 4)
|
|
1830
|
-
], 4)) : e.mode !== "pre-fetched" && s.value ? (m(),
|
|
1887
|
+
], 4)) : e.mode !== "pre-fetched" && s.value ? (m(), b("div", {
|
|
1831
1888
|
key: 1,
|
|
1832
|
-
style: S(
|
|
1889
|
+
style: S(T(Se))
|
|
1833
1890
|
}, [
|
|
1834
1891
|
$("div", {
|
|
1835
|
-
style: S(
|
|
1892
|
+
style: S(T(Ie))
|
|
1836
1893
|
}, "Error Loading Widget", 4),
|
|
1837
1894
|
$("div", {
|
|
1838
|
-
style: S(
|
|
1839
|
-
},
|
|
1840
|
-
], 4)) : e.mode !== "pre-fetched" && !i.value ? (m(),
|
|
1895
|
+
style: S(T(ke))
|
|
1896
|
+
}, Y(s.value), 5)
|
|
1897
|
+
], 4)) : e.mode !== "pre-fetched" && !i.value ? (m(), b("div", {
|
|
1841
1898
|
key: 2,
|
|
1842
|
-
style: S(
|
|
1899
|
+
style: S(T(Se))
|
|
1843
1900
|
}, [
|
|
1844
1901
|
$("div", {
|
|
1845
|
-
style: S(
|
|
1902
|
+
style: S(T(Ie))
|
|
1846
1903
|
}, "No Widget Data", 4),
|
|
1847
1904
|
$("div", {
|
|
1848
|
-
style: S(
|
|
1905
|
+
style: S(T(ke))
|
|
1849
1906
|
}, "No widget data available", 4)
|
|
1850
|
-
], 4)) : c.value && i.value ? (m(),
|
|
1851
|
-
|
|
1907
|
+
], 4)) : c.value && i.value ? (m(), b(I, { key: 3 }, [
|
|
1908
|
+
d.value ? (m(), A(fo, {
|
|
1852
1909
|
key: 0,
|
|
1853
1910
|
"display-item-list": i.value.displayItemList,
|
|
1854
1911
|
"widget-collections": i.value.widgetCollections,
|
|
1855
1912
|
plugins: a.value,
|
|
1856
|
-
"component-props": e.componentProps
|
|
1857
|
-
|
|
1913
|
+
"component-props": e.componentProps,
|
|
1914
|
+
mounts: e.mounts
|
|
1915
|
+
}, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts"])) : (m(), A(ho, {
|
|
1858
1916
|
key: 1,
|
|
1859
1917
|
"display-item-list": i.value.displayItemList,
|
|
1860
1918
|
"is-compose-mode": !1,
|
|
@@ -1863,188 +1921,189 @@ const Co = {
|
|
|
1863
1921
|
"show-drop-containers": !1,
|
|
1864
1922
|
"redux-device-display-type": "desktop",
|
|
1865
1923
|
plugins: a.value,
|
|
1866
|
-
"component-props": e.componentProps
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1924
|
+
"component-props": e.componentProps,
|
|
1925
|
+
mounts: e.mounts
|
|
1926
|
+
}, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props", "mounts"]))
|
|
1927
|
+
], 64)) : W("", !0)
|
|
1928
|
+
], 8, Do));
|
|
1870
1929
|
}
|
|
1871
1930
|
});
|
|
1872
|
-
class
|
|
1931
|
+
class H extends Error {
|
|
1873
1932
|
constructor(n, o) {
|
|
1874
1933
|
super(n);
|
|
1875
|
-
|
|
1934
|
+
ye(this, "status");
|
|
1876
1935
|
this.name = "FetchRuleCMSWidgetError", this.status = o;
|
|
1877
1936
|
}
|
|
1878
1937
|
}
|
|
1879
|
-
async function
|
|
1938
|
+
async function Ho(e) {
|
|
1880
1939
|
const { publishedKey: t, token: n, endpoint: o, fetchOptions: s } = e;
|
|
1881
1940
|
if (!t)
|
|
1882
|
-
throw new
|
|
1883
|
-
|
|
1941
|
+
throw new H(
|
|
1942
|
+
L(n) ? "Widget key is required" : "Published key is required"
|
|
1884
1943
|
);
|
|
1885
1944
|
if (!n)
|
|
1886
|
-
throw new
|
|
1887
|
-
const i =
|
|
1945
|
+
throw new H("Token is required");
|
|
1946
|
+
const i = $e({ publishedKey: t, token: n, endpoint: o }), c = await fetch(i, {
|
|
1888
1947
|
method: "GET",
|
|
1889
1948
|
headers: { "Content-Type": "application/json" },
|
|
1890
|
-
...
|
|
1949
|
+
...L(n) ? { cache: "no-store" } : {},
|
|
1891
1950
|
...s
|
|
1892
1951
|
});
|
|
1893
1952
|
if (!c.ok) {
|
|
1894
1953
|
const a = await c.json().catch(() => ({ error: "Unknown error" }));
|
|
1895
|
-
throw new
|
|
1954
|
+
throw new H(
|
|
1896
1955
|
a.error || `Request failed with status ${c.status}`,
|
|
1897
1956
|
c.status
|
|
1898
1957
|
);
|
|
1899
1958
|
}
|
|
1900
|
-
const
|
|
1901
|
-
if (!
|
|
1902
|
-
throw new
|
|
1903
|
-
return
|
|
1959
|
+
const d = await c.json();
|
|
1960
|
+
if (!d.success)
|
|
1961
|
+
throw new H("Failed to fetch widget data");
|
|
1962
|
+
return Ke(d.data);
|
|
1904
1963
|
}
|
|
1905
|
-
async function
|
|
1906
|
-
const { data: t, libraries: n } = e, o =
|
|
1964
|
+
async function Go(e) {
|
|
1965
|
+
const { data: t, libraries: n } = e, o = le({
|
|
1907
1966
|
displayItemList: t.displayItemList,
|
|
1908
1967
|
widgetCollections: t.widgetCollections
|
|
1909
1968
|
});
|
|
1910
|
-
return
|
|
1969
|
+
return q().resolve({ registrations: n, referenced: o });
|
|
1911
1970
|
}
|
|
1912
1971
|
export {
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
1972
|
+
Eo as AlignContentTypes,
|
|
1973
|
+
fo as BreakpointVariantRender,
|
|
1974
|
+
Ee as COLLECTION_TYPE_PREFIX,
|
|
1975
|
+
me as COMPONENT_PROPS_PATH_SEPARATOR,
|
|
1976
|
+
pe as CSS_CLASSES_ATTRIBUTE_NAME,
|
|
1977
|
+
Ot as CSS_VARIABLE_NAME_MAX_LENGTH,
|
|
1978
|
+
Wt as CSS_VARIABLE_NAME_PATTERN,
|
|
1979
|
+
bt as DEFAULT_CLOUDINARY_CLOUD_NAME,
|
|
1980
|
+
_ as DEFAULT_LIBRARY_ID,
|
|
1981
|
+
Rn as DEFAULT_ROW_GAP,
|
|
1982
|
+
ot as DEV_CLIENT_TOKEN_PREFIX,
|
|
1983
|
+
lt as DEV_WIDGET_API_PATH,
|
|
1984
|
+
$o as DeviceDisplayTypes,
|
|
1985
|
+
uo as DisplayComponent,
|
|
1986
|
+
re as DisplayItemTypes,
|
|
1987
|
+
Pe as DragItemIdPrefixTypes,
|
|
1988
|
+
mt as EMBEDDED_KEY_SEPARATOR,
|
|
1989
|
+
rn as FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY,
|
|
1990
|
+
H as FetchRuleCMSWidgetError,
|
|
1991
|
+
je as HIDE_WIDGET_ATTRIBUTE_NAME,
|
|
1992
|
+
we as JustifyContentTypes,
|
|
1993
|
+
ft as PUBLISHED_KEY_SEPARATOR,
|
|
1994
|
+
rt as PUBLISHED_WIDGET_API_PATH,
|
|
1995
|
+
Po as PageViewTypes,
|
|
1996
|
+
st as RULECMS_API_ORIGIN,
|
|
1997
|
+
Ko as RULECMS_PUBLISHED_KEY_ATTRIBUTE,
|
|
1998
|
+
Me as RULECMS_WIDGET_CONTEXT_KEY,
|
|
1999
|
+
ho as RenderComponents,
|
|
2000
|
+
oe as RenderComponentsForDevice,
|
|
2001
|
+
po as RenderComponentsInner,
|
|
2002
|
+
Uo as RuleCMSWidget,
|
|
2003
|
+
Bo as RuleCMSWidgetProvider,
|
|
2004
|
+
jn as WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE,
|
|
2005
|
+
it as WIDGET_CACHE_API_ORIGIN,
|
|
2006
|
+
en as alignContentAllowlist,
|
|
2007
|
+
Jt as alignItemsAllowlist,
|
|
2008
|
+
on as backgroundPositionAllowlist,
|
|
2009
|
+
sn as backgroundRepeatAllowlist,
|
|
2010
|
+
nn as backgroundSizeAllowlist,
|
|
2011
|
+
ln as borderStyleKeywords,
|
|
2012
|
+
Ft as boxSpacingSideKeys,
|
|
2013
|
+
_o as boxSpacingStyleAttributeEntries,
|
|
2014
|
+
Nt as buildCloudinaryBackgroundUrl,
|
|
2015
|
+
$e as buildWidgetFetchUrl,
|
|
2016
|
+
Un as collectComponentInstancePaths,
|
|
2017
|
+
le as collectReferencedLibraryIds,
|
|
2018
|
+
nt as composeSourceComponentsPlugin,
|
|
2019
|
+
q as createComponentLibraryRegistry,
|
|
2020
|
+
Q as cssAttrArrayKey,
|
|
2021
|
+
ht as defaultPageWidth,
|
|
2022
|
+
Tn as deriveDisplayFlexIfNeeded,
|
|
2023
|
+
Fo as desktopModeWidth,
|
|
2024
|
+
Ho as fetchRuleCMSWidget,
|
|
2025
|
+
Gn as findUnmatchedComponentPropsKeys,
|
|
2026
|
+
tn as flexDirectionAllowlist,
|
|
2027
|
+
Qt as flexWrapAllowlist,
|
|
2028
|
+
Ht as fontFamilyAllowlist,
|
|
2029
|
+
zt as fontStyleAllowlist,
|
|
2030
|
+
Gt as fontWeightAllowlist,
|
|
2031
|
+
gn as formatBackgroundImageStyles,
|
|
2032
|
+
hn as formatBorderStyles,
|
|
2033
|
+
bn as formatBoxShadowStyles,
|
|
2034
|
+
Cn as formatBoxSpacingStyles,
|
|
2035
|
+
vn as formatCssColorStyles,
|
|
2036
|
+
ue as formatCssColorValue,
|
|
2037
|
+
An as formatCssEnumStyles,
|
|
2038
|
+
Sn as formatCssLengthStyles,
|
|
2039
|
+
k as formatCssVariable,
|
|
2040
|
+
Vo as formatCssVariableStyles,
|
|
2041
|
+
In as formatLineHeightStyles,
|
|
2042
|
+
Dn as formatObjectStyleAttribute,
|
|
2043
|
+
kn as formatOpacityStyles,
|
|
2044
|
+
N as formatSpacingSideValue,
|
|
2045
|
+
yt as generatePublishedKey,
|
|
2046
|
+
Oo as generatePublishedKeyForEmbedded,
|
|
2047
|
+
Le as getCollectionIdForCollectionType,
|
|
2048
|
+
G as getColumnAttributes,
|
|
2049
|
+
Ce as getComponentAttributesAndStyles,
|
|
2050
|
+
te as getComponentsPluginFromPlugins,
|
|
2051
|
+
w as getCssVariableFromLeaf,
|
|
2052
|
+
Pn as getDefaultDimensionAttributes,
|
|
2053
|
+
O as getDeviceTypeBasedAttributes,
|
|
2054
|
+
Ro as getDragItemId,
|
|
2055
|
+
at as getDragItemPrefixAndId,
|
|
2056
|
+
ut as getIdAndPrefix,
|
|
2057
|
+
En as getMergedAttributes,
|
|
2058
|
+
Lo as getNameAndInstanceIdFromWidgetKey,
|
|
2059
|
+
Mo as getNameFromWidgetKey,
|
|
2060
|
+
dt as getWidgetKeyForCollection,
|
|
2061
|
+
No as getWidgetKeyForCollectionWithPrefix,
|
|
2062
|
+
pt as getWidgetKeyForPublishedCollection,
|
|
2063
|
+
Wo as getWidgetKeyForPublishedCollectionWithPrefix,
|
|
2064
|
+
fn as hasBoxShadowLeaf,
|
|
2065
|
+
Xn as hasDeviceDivergentValues,
|
|
2066
|
+
P as hasInvalidCssVariable,
|
|
2067
|
+
$n as hasItems,
|
|
2068
|
+
jo as incrementVersion,
|
|
2069
|
+
jt as isBackgroundImageValue,
|
|
2070
|
+
cn as isBorderStyleValue,
|
|
2071
|
+
an as isBorderValue,
|
|
2072
|
+
pn as isBoxShadowValue,
|
|
2073
|
+
Vt as isBoxSpacingValue,
|
|
2074
|
+
Et as isCloudinaryCloudName,
|
|
2075
|
+
Pt as isCloudinaryPublicId,
|
|
2076
|
+
Rt as isCloudinaryTransformationString,
|
|
2077
|
+
ae as isCssColorValue,
|
|
2078
|
+
Ut as isCssEnumValue,
|
|
2079
|
+
Oe as isCssVariableName,
|
|
2080
|
+
L as isDevClientToken,
|
|
2081
|
+
mn as isLineHeightValue,
|
|
2082
|
+
yn as isOpacityValue,
|
|
2083
|
+
Mn as isRowHiddenForDevice,
|
|
2084
|
+
$t as isSafeImageUrl,
|
|
2085
|
+
M as isSpacingSideValue,
|
|
2086
|
+
Fn as isWidgetHiddenForDevice,
|
|
2087
|
+
Zt as justifyContentAllowlist,
|
|
2088
|
+
fe as normalizeCssClasses,
|
|
2089
|
+
de as objectStyleAttributeRegistry,
|
|
2090
|
+
ee as overflowAllowlist,
|
|
2091
|
+
Ne as phoneModeWidth,
|
|
2092
|
+
Ke as prepareRuleCMSWidgetData,
|
|
2093
|
+
Te as resolveKey,
|
|
2094
|
+
Nn as resolveRowStyles,
|
|
2095
|
+
ct as resolveWidgetApiOrigin,
|
|
2096
|
+
Vn as resolveWidgetContainerStyles,
|
|
2097
|
+
Kn as resolveWidgetInstanceProps,
|
|
2098
|
+
Go as resolveWidgetLibraries,
|
|
2099
|
+
Ln as rowBasedPropertiesAreAssigned,
|
|
2100
|
+
ce as spacingKeywords,
|
|
2101
|
+
Bt as spacingLengthUnits,
|
|
2102
|
+
We as tabletModeWidth,
|
|
2103
|
+
Yt as textAlignAllowlist,
|
|
2104
|
+
qt as textDecorationAllowlist,
|
|
2105
|
+
Xt as textTransformAllowlist,
|
|
2106
|
+
Re as typeHasPrefix,
|
|
2107
|
+
zn as warnUnmatchedComponentProps,
|
|
2108
|
+
_n as widgetBasedPropertiesAreAssigned
|
|
2050
2109
|
};
|