@rulecms/widget-vue 0.1.0 → 0.2.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/dist/index.cjs +6 -6
- package/dist/index.d.ts +12 -5
- package/dist/index.js +763 -719
- 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 me = (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 m, openBlock as y, createElementBlock as b, normalizeStyle as S, normalizeClass as B, createBlock as A, resolveDynamicComponent as R, withCtx as F, 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 j, onMounted as Ze, onBeforeUnmount as xe, inject as Je, unref as T } from "vue";
|
|
5
|
+
const V = "default";
|
|
6
|
+
function Te(e, t) {
|
|
7
|
+
return !(e != null && e.length) || e === V ? 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 ? [V, ...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[V]))
|
|
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 === V;
|
|
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 = "---", yt = "___";
|
|
240
|
+
function mt(e, t) {
|
|
241
|
+
return `${e}${ft}${t}`;
|
|
231
242
|
}
|
|
232
|
-
function
|
|
233
|
-
return `${
|
|
243
|
+
function _o(e, t, n) {
|
|
244
|
+
return `${mt(e, t)}${yt}${n}`;
|
|
234
245
|
}
|
|
235
|
-
function
|
|
246
|
+
function Oo(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 === V ? 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 jo = /* @__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", Bo = 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_-]+$/, _t = 200, _e = (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 <= _t && 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 _e(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 : !_e(t);
|
|
342
|
+
}, Fo = (e, t) => {
|
|
343
|
+
const n = w(e);
|
|
344
|
+
return n ? { [t]: k(n) } : void 0;
|
|
345
|
+
}, Ot = (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
|
+
}, jt = ["px", "%", "em", "rem", "vh", "vw"], ce = ["inherit", "unset"], Bt = ["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) : jt.includes(n.unit) ? typeof n.value != "number" || !Number.isFinite(n.value) ? !1 : t.allowNegative !== !1 || n.value >= 0 : !1;
|
|
357
|
+
}, Ft = (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 Bt) {
|
|
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
|
+
}, Vt = [...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" ? Vt.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, yn = (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
|
+
}, mn = (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 (!Ot(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 (!Ft(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 (!yn(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 (!mn(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
|
+
}, Vo = 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
|
+
}, _ = ({
|
|
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 } = _({
|
|
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 = _({
|
|
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 = _({
|
|
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, _n = /[\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(_n, "");
|
|
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
|
+
}, Oe = "hide-component-3-resolutions", On = [
|
|
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
|
+
Oe
|
|
940
|
+
], jn = new Set(
|
|
941
|
+
On
|
|
931
942
|
);
|
|
932
|
-
function
|
|
943
|
+
function Bn({
|
|
933
944
|
containerAttributes: e,
|
|
934
945
|
deviceDisplayType: t
|
|
935
946
|
}) {
|
|
936
947
|
var o;
|
|
937
|
-
const n =
|
|
948
|
+
const n = _({
|
|
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[Oe]) === "true";
|
|
942
953
|
}
|
|
943
|
-
function
|
|
954
|
+
function Fn({
|
|
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]) => !jn.has(c)
|
|
954
965
|
)
|
|
955
|
-
) : e, s =
|
|
966
|
+
) : e, s = _({
|
|
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 Vn(e) {
|
|
967
978
|
return Object.keys(e.styles).length > 0 || !!e.cssClasses;
|
|
968
979
|
}
|
|
969
|
-
const
|
|
970
|
-
function
|
|
980
|
+
const ye = "/";
|
|
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(ye), 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(ye)
|
|
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 = `${ye}${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 je = parseInt(Ne, 10), Be = parseInt(We, 10), Zn = je + 1, Jn = Be + 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: ${je}px) { ${t} { display: block; } }
|
|
1106
|
+
@media (min-width: ${Zn}px) and (max-width: ${Be}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 = m(() => {
|
|
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 = m(
|
|
1135
1146
|
() => i.value ? `.${o} {
|
|
1136
1147
|
${i.value}
|
|
1137
1148
|
}` : ""
|
|
1138
|
-
),
|
|
1139
|
-
() => !t.isComposeMode &&
|
|
1149
|
+
), d = m(
|
|
1150
|
+
() => !t.isComposeMode && Bn({
|
|
1140
1151
|
containerAttributes: t.displayItemList.containerAttributes,
|
|
1141
1152
|
deviceDisplayType: t.deviceDisplayType
|
|
1142
1153
|
})
|
|
1143
|
-
), a =
|
|
1144
|
-
() =>
|
|
1154
|
+
), a = m(
|
|
1155
|
+
() => Fn({
|
|
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 = m(() => {
|
|
1161
|
+
var v;
|
|
1162
|
+
const h = ((v = t.displayItemList.containerAttributes) == null ? void 0 : v[Q]) || [], g = Vn(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 = m(
|
|
1154
1165
|
() => [i.value ? o : void 0, a.value.cssClasses].filter(Boolean).join(" ")
|
|
1155
|
-
),
|
|
1166
|
+
), f = m(() => {
|
|
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) => (
|
|
1165
|
-
hidden:
|
|
1166
|
-
class:
|
|
1167
|
-
style: S(
|
|
1174
|
+
}), u = m(() => r.value ? l.value : ""), p = m(() => d.value ? { display: "none" } : r.value ? f.value : { display: "contents" });
|
|
1175
|
+
return (h, g) => (y(), b("div", {
|
|
1176
|
+
hidden: d.value || void 0,
|
|
1177
|
+
class: B(u.value || void 0),
|
|
1178
|
+
style: S(p.value)
|
|
1168
1179
|
}, [
|
|
1169
|
-
i.value ? (
|
|
1170
|
-
default:
|
|
1171
|
-
|
|
1180
|
+
i.value ? (y(), A(R("style"), { key: 0 }, {
|
|
1181
|
+
default: F(() => [
|
|
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 = m(
|
|
1206
|
+
() => !t.isComposeMode && Mn({ row: t.row, deviceDisplayType: t.deviceDisplayType })
|
|
1207
|
+
), s = m(
|
|
1208
|
+
() => t.showDropContainers || Ln(t.row) || n(t.isComposeMode, t.row, t.isWithinCollection)
|
|
1209
|
+
), i = m(
|
|
1210
|
+
() => Nn({
|
|
1200
1211
|
row: t.row,
|
|
1201
1212
|
deviceDisplayType: t.deviceDisplayType,
|
|
1202
1213
|
isComposeMode: t.isComposeMode
|
|
1203
1214
|
})
|
|
1204
|
-
), c =
|
|
1215
|
+
), c = m(() => {
|
|
1205
1216
|
var l;
|
|
1206
|
-
const r =
|
|
1217
|
+
const r = _({
|
|
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) => (
|
|
1224
|
+
}), d = m(() => s.value ? c.value : ""), a = m(() => o.value ? { display: "none" } : s.value ? i.value : { display: "contents" });
|
|
1225
|
+
return (r, l) => (y(), b("div", {
|
|
1215
1226
|
hidden: o.value || void 0,
|
|
1216
|
-
class:
|
|
1227
|
+
class: B(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
|
+
}), Fe = [
|
|
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 ? Fe.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 Fe)
|
|
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: {},
|
|
@@ -1331,50 +1342,50 @@ ${i.value}
|
|
|
1331
1342
|
widgetInstanceProps: {}
|
|
1332
1343
|
},
|
|
1333
1344
|
setup(e) {
|
|
1334
|
-
const t = e, n =
|
|
1345
|
+
const t = e, n = m(() => t.components[Te(t.libraryId, t.componentType)]), o = m(() => {
|
|
1335
1346
|
var h;
|
|
1336
|
-
const
|
|
1337
|
-
return
|
|
1347
|
+
const p = (h = n.value) == null ? void 0 : h.card;
|
|
1348
|
+
return p || (console.error(
|
|
1338
1349
|
`DisplayComponent: Component with type ${t.componentType}${t.libraryId ? ` (library "${t.libraryId}")` : ""} not found in components`
|
|
1339
1350
|
), null);
|
|
1340
|
-
}), s =
|
|
1351
|
+
}), s = m(() => ({
|
|
1341
1352
|
componentAttributes: t.componentAttributes,
|
|
1342
1353
|
styleProps: t.styleProps
|
|
1343
|
-
})), i =
|
|
1344
|
-
() => n.value ?
|
|
1345
|
-
), c =
|
|
1346
|
-
() => i.value ?
|
|
1347
|
-
), a =
|
|
1354
|
+
})), i = m(
|
|
1355
|
+
() => n.value ? co(n.value, s.value) : !1
|
|
1356
|
+
), c = m(() => io(t.styleProps)), d = m(
|
|
1357
|
+
() => i.value ? ro(t.styleProps) : t.styleProps
|
|
1358
|
+
), a = m(
|
|
1348
1359
|
() => {
|
|
1349
|
-
var
|
|
1350
|
-
return
|
|
1360
|
+
var p;
|
|
1361
|
+
return fe((p = t.componentAttributes) == null ? void 0 : p[pe]);
|
|
1351
1362
|
}
|
|
1352
|
-
), r =
|
|
1353
|
-
() => !i.value || (n.value ?
|
|
1354
|
-
),
|
|
1363
|
+
), r = m(() => i.value && lo(c.value)), l = m(
|
|
1364
|
+
() => !i.value || (n.value ? ao(n.value, s.value) : !1)
|
|
1365
|
+
), f = m(
|
|
1355
1366
|
() => !r.value && l.value ? a.value : void 0
|
|
1356
|
-
), u =
|
|
1367
|
+
), u = m(() => ({
|
|
1357
1368
|
componentAttributes: t.componentAttributes,
|
|
1358
|
-
styleProps:
|
|
1359
|
-
className:
|
|
1369
|
+
styleProps: d.value,
|
|
1370
|
+
className: f.value,
|
|
1360
1371
|
widgetInstanceProps: t.widgetInstanceProps
|
|
1361
1372
|
}));
|
|
1362
|
-
return (
|
|
1363
|
-
r.value ? (
|
|
1373
|
+
return (p, h) => o.value ? (y(), b(I, { key: 0 }, [
|
|
1374
|
+
r.value ? (y(), b("div", {
|
|
1364
1375
|
key: 0,
|
|
1365
|
-
class:
|
|
1376
|
+
class: B(a.value || void 0),
|
|
1366
1377
|
style: S(c.value)
|
|
1367
1378
|
}, [
|
|
1368
|
-
(
|
|
1369
|
-
], 6)) : !l.value && a.value ? (
|
|
1379
|
+
(y(), A(R(o.value), Z(ge(u.value)), null, 16))
|
|
1380
|
+
], 6)) : !l.value && a.value ? (y(), b("div", {
|
|
1370
1381
|
key: 1,
|
|
1371
|
-
class:
|
|
1382
|
+
class: B(a.value)
|
|
1372
1383
|
}, [
|
|
1373
|
-
(
|
|
1374
|
-
], 2)) : (
|
|
1375
|
-
], 64)) :
|
|
1384
|
+
(y(), A(R(o.value), Z(ge(u.value)), null, 16))
|
|
1385
|
+
], 2)) : (y(), A(R(o.value), Z(qe({ key: 2 }, u.value)), null, 16))
|
|
1386
|
+
], 64)) : W("", !0);
|
|
1376
1387
|
}
|
|
1377
|
-
}),
|
|
1388
|
+
}), po = /* @__PURE__ */ D({
|
|
1378
1389
|
__name: "RenderComponentsInner",
|
|
1379
1390
|
props: {
|
|
1380
1391
|
displayItemList: {},
|
|
@@ -1389,24 +1400,24 @@ ${i.value}
|
|
|
1389
1400
|
ancestorColumnIds: {}
|
|
1390
1401
|
},
|
|
1391
1402
|
setup(e) {
|
|
1392
|
-
const t = e, n = () =>
|
|
1403
|
+
const t = e, n = () => te(t.plugins).components;
|
|
1393
1404
|
function o(a) {
|
|
1394
|
-
if (t.isComposeMode && a.type ===
|
|
1405
|
+
if (t.isComposeMode && a.type === re.DroppableBox)
|
|
1395
1406
|
return !1;
|
|
1396
|
-
const { componentAttributesBasedOnDevice: r } =
|
|
1407
|
+
const { componentAttributesBasedOnDevice: r } = Ce({
|
|
1397
1408
|
col: a,
|
|
1398
1409
|
deviceDisplayType: t.deviceDisplayType,
|
|
1399
1410
|
isComposeMode: t.isComposeMode,
|
|
1400
|
-
sourceComponentsPlugin:
|
|
1411
|
+
sourceComponentsPlugin: te(t.plugins)
|
|
1401
1412
|
}), l = !!r && r["hide-component-3-resolutions"] === "true";
|
|
1402
1413
|
return !(!t.isComposeMode && l);
|
|
1403
1414
|
}
|
|
1404
1415
|
function s(a) {
|
|
1405
|
-
const { componentAttributesBasedOnDevice: r, componentStyles: l } =
|
|
1416
|
+
const { componentAttributesBasedOnDevice: r, componentStyles: l } = Ce({
|
|
1406
1417
|
col: a,
|
|
1407
1418
|
deviceDisplayType: t.deviceDisplayType,
|
|
1408
1419
|
isComposeMode: t.isComposeMode,
|
|
1409
|
-
sourceComponentsPlugin:
|
|
1420
|
+
sourceComponentsPlugin: te(t.plugins)
|
|
1410
1421
|
});
|
|
1411
1422
|
return {
|
|
1412
1423
|
componentAttributes: r,
|
|
@@ -1414,7 +1425,7 @@ ${i.value}
|
|
|
1414
1425
|
};
|
|
1415
1426
|
}
|
|
1416
1427
|
function i(a) {
|
|
1417
|
-
const r =
|
|
1428
|
+
const r = Le(a.type);
|
|
1418
1429
|
if (!(r != null && r.length))
|
|
1419
1430
|
return null;
|
|
1420
1431
|
const l = a.collection ?? t.widgetCollections[r];
|
|
@@ -1422,42 +1433,42 @@ ${i.value}
|
|
|
1422
1433
|
throw new Error(
|
|
1423
1434
|
`DisplayCollection - Collection with ID ${r} not found in widgetCollections. Available collections: ${Object.keys(t.widgetCollections).join(", ")}`
|
|
1424
1435
|
);
|
|
1425
|
-
return !l.collectionRows ||
|
|
1436
|
+
return !l.collectionRows || !$n(l.collectionRows) ? null : l.collectionRows;
|
|
1426
1437
|
}
|
|
1427
1438
|
function c(a) {
|
|
1428
1439
|
return [...t.ancestorColumnIds ?? [], a];
|
|
1429
1440
|
}
|
|
1430
|
-
function
|
|
1431
|
-
return
|
|
1441
|
+
function d(a) {
|
|
1442
|
+
return Kn({
|
|
1432
1443
|
componentProps: t.componentProps,
|
|
1433
1444
|
ancestorColumnIds: t.ancestorColumnIds,
|
|
1434
1445
|
columnId: a
|
|
1435
1446
|
});
|
|
1436
1447
|
}
|
|
1437
1448
|
return (a, r) => {
|
|
1438
|
-
const l =
|
|
1439
|
-
return
|
|
1449
|
+
const l = Xe("RenderComponentsInner", !0);
|
|
1450
|
+
return y(), A(to, {
|
|
1440
1451
|
"display-item-list": e.displayItemList,
|
|
1441
1452
|
"is-compose-mode": e.isComposeMode,
|
|
1442
1453
|
"show-drop-containers": e.showDropContainers,
|
|
1443
1454
|
"is-within-collection": e.isWithinCollection,
|
|
1444
1455
|
"device-display-type": e.deviceDisplayType
|
|
1445
1456
|
}, {
|
|
1446
|
-
default:
|
|
1447
|
-
(
|
|
1448
|
-
key:
|
|
1449
|
-
row:
|
|
1457
|
+
default: F(() => [
|
|
1458
|
+
(y(!0), b(I, null, z(e.displayItemList.rows, (f) => (y(), A(oo, {
|
|
1459
|
+
key: f.id,
|
|
1460
|
+
row: f,
|
|
1450
1461
|
"is-compose-mode": e.isComposeMode,
|
|
1451
1462
|
"show-drop-containers": e.showDropContainers,
|
|
1452
1463
|
"is-within-collection": e.isWithinCollection,
|
|
1453
1464
|
"device-display-type": e.deviceDisplayType
|
|
1454
1465
|
}, {
|
|
1455
|
-
default:
|
|
1456
|
-
(
|
|
1466
|
+
default: F(() => [
|
|
1467
|
+
(y(!0), b(I, null, z(f.columns, (u) => (y(), b(I, {
|
|
1457
1468
|
key: u.id
|
|
1458
1469
|
}, [
|
|
1459
|
-
o(u) ? (
|
|
1460
|
-
i(u) ? (
|
|
1470
|
+
o(u) ? (y(), b(I, { key: 0 }, [
|
|
1471
|
+
i(u) ? (y(), A(l, {
|
|
1461
1472
|
key: 0,
|
|
1462
1473
|
"display-item-list": i(u),
|
|
1463
1474
|
"is-compose-mode": e.isComposeMode,
|
|
@@ -1469,16 +1480,16 @@ ${i.value}
|
|
|
1469
1480
|
"device-display-type": e.deviceDisplayType,
|
|
1470
1481
|
"component-props": e.componentProps,
|
|
1471
1482
|
"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"])) : (
|
|
1483
|
+
}, 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"])) : (y(), A(uo, {
|
|
1473
1484
|
key: 1,
|
|
1474
1485
|
"component-type": u.type,
|
|
1475
1486
|
"library-id": u.libraryId,
|
|
1476
1487
|
"component-attributes": s(u).componentAttributes,
|
|
1477
1488
|
components: n(),
|
|
1478
1489
|
"style-props": s(u).styleProps,
|
|
1479
|
-
"widget-instance-props":
|
|
1490
|
+
"widget-instance-props": d(u.id)
|
|
1480
1491
|
}, null, 8, ["component-type", "library-id", "component-attributes", "components", "style-props", "widget-instance-props"]))
|
|
1481
|
-
], 64)) :
|
|
1492
|
+
], 64)) : W("", !0)
|
|
1482
1493
|
], 64))), 128))
|
|
1483
1494
|
]),
|
|
1484
1495
|
_: 2
|
|
@@ -1488,7 +1499,7 @@ ${i.value}
|
|
|
1488
1499
|
}, 8, ["display-item-list", "is-compose-mode", "show-drop-containers", "is-within-collection", "device-display-type"]);
|
|
1489
1500
|
};
|
|
1490
1501
|
}
|
|
1491
|
-
}),
|
|
1502
|
+
}), oe = /* @__PURE__ */ D({
|
|
1492
1503
|
__name: "RenderComponentsForDevice",
|
|
1493
1504
|
props: {
|
|
1494
1505
|
displayItemList: {},
|
|
@@ -1505,7 +1516,7 @@ ${i.value}
|
|
|
1505
1516
|
setup(e) {
|
|
1506
1517
|
return (t, n) => {
|
|
1507
1518
|
var o, s;
|
|
1508
|
-
return (s = (o = e.displayItemList) == null ? void 0 : o.rows) != null && s.length ? (
|
|
1519
|
+
return (s = (o = e.displayItemList) == null ? void 0 : o.rows) != null && s.length ? (y(), A(po, {
|
|
1509
1520
|
key: 0,
|
|
1510
1521
|
"display-item-list": e.displayItemList,
|
|
1511
1522
|
"is-compose-mode": e.isComposeMode,
|
|
@@ -1517,10 +1528,26 @@ ${i.value}
|
|
|
1517
1528
|
"device-display-type": e.deviceDisplayType,
|
|
1518
1529
|
"component-props": e.componentProps,
|
|
1519
1530
|
"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"])) :
|
|
1531
|
+
}, 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"])) : W("", !0);
|
|
1521
1532
|
};
|
|
1522
1533
|
}
|
|
1523
|
-
}),
|
|
1534
|
+
}), Ve = /* @__PURE__ */ D({
|
|
1535
|
+
__name: "LibraryStylesheets",
|
|
1536
|
+
props: {
|
|
1537
|
+
stylesheets: {}
|
|
1538
|
+
},
|
|
1539
|
+
setup(e) {
|
|
1540
|
+
return (t, n) => (y(!0), b(I, null, z(e.stylesheets ?? [], (o) => (y(), A(R("style"), {
|
|
1541
|
+
key: o,
|
|
1542
|
+
"data-rulecms-library-stylesheet": ""
|
|
1543
|
+
}, {
|
|
1544
|
+
default: F(() => [
|
|
1545
|
+
ie(Y(o), 1)
|
|
1546
|
+
]),
|
|
1547
|
+
_: 2
|
|
1548
|
+
}, 1024))), 128));
|
|
1549
|
+
}
|
|
1550
|
+
}), fo = /* @__PURE__ */ D({
|
|
1524
1551
|
__name: "BreakpointVariantRender",
|
|
1525
1552
|
props: {
|
|
1526
1553
|
displayItemList: {},
|
|
@@ -1532,47 +1559,55 @@ ${i.value}
|
|
|
1532
1559
|
setup(e) {
|
|
1533
1560
|
const t = ["Phone", "Tablet", "Desktop"];
|
|
1534
1561
|
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
|
-
|
|
1562
|
+
const o = e, s = `rulecms-bp-${++n}`, i = m(() => o.scopeIdInput ?? s), c = m(
|
|
1563
|
+
() => Xn(o.displayItemList, o.widgetCollections)
|
|
1564
|
+
), d = m(() => Qn(i.value));
|
|
1565
|
+
return (a, r) => {
|
|
1566
|
+
var l;
|
|
1567
|
+
return y(), b(I, null, [
|
|
1568
|
+
ne(Ve, {
|
|
1569
|
+
stylesheets: (l = e.plugins.sourceComponents) == null ? void 0 : l.stylesheets
|
|
1570
|
+
}, null, 8, ["stylesheets"]),
|
|
1571
|
+
c.value ? (y(), b(I, { key: 1 }, [
|
|
1572
|
+
(y(), A(R("style"), null, {
|
|
1573
|
+
default: F(() => [
|
|
1574
|
+
ie(Y(d.value), 1)
|
|
1575
|
+
]),
|
|
1576
|
+
_: 1
|
|
1577
|
+
})),
|
|
1578
|
+
(y(), b(I, null, z(t, (f) => $("div", {
|
|
1579
|
+
key: f,
|
|
1580
|
+
class: B(`${i.value}-${f.toLowerCase()}`)
|
|
1581
|
+
}, [
|
|
1582
|
+
ne(oe, {
|
|
1583
|
+
"display-item-list": e.displayItemList,
|
|
1584
|
+
"is-compose-mode": !1,
|
|
1585
|
+
"is-within-collection": !1,
|
|
1586
|
+
"widget-collections": e.widgetCollections,
|
|
1587
|
+
"show-drop-containers": !1,
|
|
1588
|
+
"redux-device-display-type": "desktop",
|
|
1589
|
+
"device-display-type": f,
|
|
1590
|
+
plugins: e.plugins,
|
|
1591
|
+
"component-props": e.componentProps
|
|
1592
|
+
}, null, 8, ["display-item-list", "widget-collections", "device-display-type", "plugins", "component-props"])
|
|
1593
|
+
], 2)), 64))
|
|
1594
|
+
], 64)) : (y(), A(oe, {
|
|
1595
|
+
key: 0,
|
|
1550
1596
|
"display-item-list": e.displayItemList,
|
|
1551
1597
|
"is-compose-mode": !1,
|
|
1552
1598
|
"is-within-collection": !1,
|
|
1553
1599
|
"widget-collections": e.widgetCollections,
|
|
1554
1600
|
"show-drop-containers": !1,
|
|
1555
1601
|
"redux-device-display-type": "desktop",
|
|
1556
|
-
"device-display-type":
|
|
1602
|
+
"device-display-type": "Desktop",
|
|
1557
1603
|
plugins: e.plugins,
|
|
1558
1604
|
"component-props": e.componentProps
|
|
1559
|
-
}, null, 8, ["display-item-list", "widget-collections", "
|
|
1560
|
-
],
|
|
1561
|
-
|
|
1562
|
-
key: 0,
|
|
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"]));
|
|
1605
|
+
}, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props"]))
|
|
1606
|
+
], 64);
|
|
1607
|
+
};
|
|
1573
1608
|
}
|
|
1574
1609
|
});
|
|
1575
|
-
function
|
|
1610
|
+
function yo(e, t, n) {
|
|
1576
1611
|
if (e)
|
|
1577
1612
|
return "Phone";
|
|
1578
1613
|
if (t)
|
|
@@ -1580,7 +1615,7 @@ function po(e, t, n) {
|
|
|
1580
1615
|
const o = (n == null ? void 0 : n.toLowerCase()) || "desktop";
|
|
1581
1616
|
return o === "phone" ? "Phone" : o === "tablet" ? "Tablet" : "Desktop";
|
|
1582
1617
|
}
|
|
1583
|
-
const
|
|
1618
|
+
const mo = `(max-width: ${Ne})`, go = `(max-width: ${We})`, ho = /* @__PURE__ */ D({
|
|
1584
1619
|
__name: "RenderComponents",
|
|
1585
1620
|
props: {
|
|
1586
1621
|
displayItemList: {},
|
|
@@ -1593,33 +1628,42 @@ const fo = `(max-width: ${Me})`, yo = `(max-width: ${Ne})`, mo = /* @__PURE__ */
|
|
|
1593
1628
|
componentProps: {}
|
|
1594
1629
|
},
|
|
1595
1630
|
setup(e) {
|
|
1596
|
-
const t = e, n =
|
|
1631
|
+
const t = e, n = j("Desktop");
|
|
1597
1632
|
let o, s;
|
|
1598
1633
|
function i() {
|
|
1599
|
-
n.value =
|
|
1634
|
+
n.value = yo(
|
|
1600
1635
|
(o == null ? void 0 : o.matches) ?? !1,
|
|
1601
1636
|
(s == null ? void 0 : s.matches) ?? !1,
|
|
1602
1637
|
t.reduxDeviceDisplayType
|
|
1603
1638
|
);
|
|
1604
1639
|
}
|
|
1605
|
-
return
|
|
1606
|
-
typeof matchMedia == "function" && (o = matchMedia(
|
|
1607
|
-
}),
|
|
1640
|
+
return Ze(() => {
|
|
1641
|
+
typeof matchMedia == "function" && (o = matchMedia(mo), s = matchMedia(go), o.addEventListener("change", i), s.addEventListener("change", i)), i();
|
|
1642
|
+
}), xe(() => {
|
|
1608
1643
|
o == null || o.removeEventListener("change", i), s == null || s.removeEventListener("change", i);
|
|
1609
|
-
}), (c,
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1644
|
+
}), (c, d) => {
|
|
1645
|
+
var a;
|
|
1646
|
+
return y(), b(I, null, [
|
|
1647
|
+
e.isWithinCollection ? W("", !0) : (y(), A(Ve, {
|
|
1648
|
+
key: 0,
|
|
1649
|
+
stylesheets: (a = e.plugins.sourceComponents) == null ? void 0 : a.stylesheets
|
|
1650
|
+
}, null, 8, ["stylesheets"])),
|
|
1651
|
+
ne(oe, {
|
|
1652
|
+
"display-item-list": e.displayItemList,
|
|
1653
|
+
"is-compose-mode": e.isComposeMode,
|
|
1654
|
+
"is-within-collection": e.isWithinCollection,
|
|
1655
|
+
"widget-collections": e.widgetCollections,
|
|
1656
|
+
"show-drop-containers": e.showDropContainers,
|
|
1657
|
+
"redux-device-display-type": e.reduxDeviceDisplayType,
|
|
1658
|
+
"device-display-type": n.value,
|
|
1659
|
+
plugins: e.plugins,
|
|
1660
|
+
"component-props": e.componentProps
|
|
1661
|
+
}, 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"])
|
|
1662
|
+
], 64);
|
|
1663
|
+
};
|
|
1620
1664
|
}
|
|
1621
1665
|
});
|
|
1622
|
-
function
|
|
1666
|
+
function bo(e) {
|
|
1623
1667
|
const t = {};
|
|
1624
1668
|
return Object.entries(e).forEach(([n, o]) => {
|
|
1625
1669
|
const s = { ...o };
|
|
@@ -1633,62 +1677,62 @@ function go(e) {
|
|
|
1633
1677
|
s.parentId && (i = `${i}@${s.parentId}`), t[i] = s;
|
|
1634
1678
|
}), t;
|
|
1635
1679
|
}
|
|
1636
|
-
function
|
|
1680
|
+
function wo(e) {
|
|
1637
1681
|
return typeof e.itemList == "string" ? JSON.parse(e.itemList) : e.itemList;
|
|
1638
1682
|
}
|
|
1639
|
-
function
|
|
1683
|
+
function Ke(e) {
|
|
1640
1684
|
return {
|
|
1641
|
-
displayItemList:
|
|
1642
|
-
widgetCollections:
|
|
1685
|
+
displayItemList: wo(e.widget),
|
|
1686
|
+
widgetCollections: bo(e.childCollections),
|
|
1643
1687
|
...e.libraries ? { libraries: e.libraries } : {}
|
|
1644
1688
|
};
|
|
1645
1689
|
}
|
|
1646
|
-
function
|
|
1647
|
-
const t = e.registry ??
|
|
1690
|
+
function Co(e) {
|
|
1691
|
+
const t = e.registry ?? q(), n = le({
|
|
1648
1692
|
displayItemList: e.displayItemList,
|
|
1649
1693
|
widgetCollections: e.widgetCollections
|
|
1650
1694
|
});
|
|
1651
1695
|
return t.resolveSync({ registrations: e.libraries, referenced: n });
|
|
1652
1696
|
}
|
|
1653
|
-
function
|
|
1654
|
-
const t = e.registry ??
|
|
1697
|
+
function vo(e) {
|
|
1698
|
+
const t = e.registry ?? q(), n = le({
|
|
1655
1699
|
displayItemList: e.displayItemList,
|
|
1656
1700
|
widgetCollections: e.widgetCollections
|
|
1657
1701
|
});
|
|
1658
1702
|
return t.resolve({ registrations: e.libraries, referenced: n });
|
|
1659
1703
|
}
|
|
1660
|
-
const
|
|
1704
|
+
const Ao = {
|
|
1661
1705
|
display: "flex",
|
|
1662
1706
|
justifyContent: "center",
|
|
1663
1707
|
alignItems: "center",
|
|
1664
1708
|
padding: "3rem",
|
|
1665
1709
|
color: "#e2e8f0"
|
|
1666
|
-
},
|
|
1710
|
+
}, So = {
|
|
1667
1711
|
display: "flex",
|
|
1668
1712
|
alignItems: "center",
|
|
1669
1713
|
gap: "1rem"
|
|
1670
|
-
},
|
|
1714
|
+
}, Io = {
|
|
1671
1715
|
width: "40px",
|
|
1672
1716
|
height: "40px",
|
|
1673
1717
|
border: "4px solid #4a5568",
|
|
1674
1718
|
borderTopColor: "#63b3ed",
|
|
1675
1719
|
borderRadius: "50%",
|
|
1676
1720
|
animation: "spin 1s linear infinite"
|
|
1677
|
-
},
|
|
1721
|
+
}, Se = {
|
|
1678
1722
|
padding: "1.5rem",
|
|
1679
1723
|
backgroundColor: "#742a2a",
|
|
1680
1724
|
border: "1px solid #9b2c2c",
|
|
1681
1725
|
borderRadius: "8px",
|
|
1682
1726
|
color: "#fed7d7"
|
|
1683
|
-
},
|
|
1727
|
+
}, Ie = {
|
|
1684
1728
|
fontSize: "16px",
|
|
1685
1729
|
fontWeight: "600",
|
|
1686
1730
|
marginBottom: "0.5rem",
|
|
1687
1731
|
color: "#feb2b2"
|
|
1688
|
-
},
|
|
1732
|
+
}, ke = {
|
|
1689
1733
|
fontSize: "14px",
|
|
1690
1734
|
color: "#fed7d7"
|
|
1691
|
-
},
|
|
1735
|
+
}, ko = `
|
|
1692
1736
|
@keyframes spin {
|
|
1693
1737
|
from {
|
|
1694
1738
|
transform: rotate(0deg);
|
|
@@ -1697,7 +1741,7 @@ const Co = {
|
|
|
1697
1741
|
transform: rotate(360deg);
|
|
1698
1742
|
}
|
|
1699
1743
|
}
|
|
1700
|
-
`,
|
|
1744
|
+
`, Ko = "data-rulecms-published-key", Do = ["data-rulecms-published-key"], Uo = /* @__PURE__ */ D({
|
|
1701
1745
|
__name: "RuleCMSWidget",
|
|
1702
1746
|
props: {
|
|
1703
1747
|
publishedKey: {},
|
|
@@ -1709,36 +1753,36 @@ const Co = {
|
|
|
1709
1753
|
componentProps: {}
|
|
1710
1754
|
},
|
|
1711
1755
|
setup(e) {
|
|
1712
|
-
const t = e, n =
|
|
1756
|
+
const t = e, n = Je(Me, null), o = j(!1), s = j(null), i = j(null), c = j(null), d = m(() => t.mode === "pre-fetched"), a = m(() => ({
|
|
1713
1757
|
sourceComponents: c.value ?? void 0
|
|
1714
1758
|
}));
|
|
1715
|
-
let r = null, l = null,
|
|
1759
|
+
let r = null, l = null, f = !1;
|
|
1716
1760
|
function u() {
|
|
1717
1761
|
if (!i.value) {
|
|
1718
1762
|
c.value = null;
|
|
1719
1763
|
return;
|
|
1720
1764
|
}
|
|
1721
|
-
const
|
|
1765
|
+
const C = t.libraries ?? (n == null ? void 0 : n.libraries), x = n == null ? void 0 : n.libraryRegistry, O = Co({
|
|
1722
1766
|
displayItemList: i.value.displayItemList,
|
|
1723
1767
|
widgetCollections: i.value.widgetCollections,
|
|
1724
|
-
libraries:
|
|
1725
|
-
registry:
|
|
1768
|
+
libraries: C,
|
|
1769
|
+
registry: x
|
|
1726
1770
|
});
|
|
1727
|
-
if (
|
|
1728
|
-
c.value =
|
|
1771
|
+
if (O) {
|
|
1772
|
+
c.value = O;
|
|
1729
1773
|
return;
|
|
1730
1774
|
}
|
|
1731
|
-
|
|
1775
|
+
vo({
|
|
1732
1776
|
displayItemList: i.value.displayItemList,
|
|
1733
1777
|
widgetCollections: i.value.widgetCollections,
|
|
1734
|
-
libraries:
|
|
1735
|
-
registry:
|
|
1736
|
-
}).then((
|
|
1737
|
-
c.value =
|
|
1778
|
+
libraries: C,
|
|
1779
|
+
registry: x
|
|
1780
|
+
}).then((X) => {
|
|
1781
|
+
c.value = X;
|
|
1738
1782
|
});
|
|
1739
1783
|
}
|
|
1740
|
-
function
|
|
1741
|
-
i.value &&
|
|
1784
|
+
function p() {
|
|
1785
|
+
i.value && zn({
|
|
1742
1786
|
componentProps: t.componentProps,
|
|
1743
1787
|
displayItemList: i.value.displayItemList,
|
|
1744
1788
|
widgetCollections: i.value.widgetCollections,
|
|
@@ -1746,57 +1790,57 @@ const Co = {
|
|
|
1746
1790
|
});
|
|
1747
1791
|
}
|
|
1748
1792
|
function h() {
|
|
1749
|
-
if (
|
|
1793
|
+
if (f || typeof document > "u")
|
|
1750
1794
|
return;
|
|
1751
|
-
const
|
|
1752
|
-
if (!document.getElementById(
|
|
1753
|
-
const
|
|
1754
|
-
|
|
1795
|
+
const C = "rulecms-widget-spinner-styles";
|
|
1796
|
+
if (!document.getElementById(C)) {
|
|
1797
|
+
const x = document.createElement("style");
|
|
1798
|
+
x.id = C, x.textContent = ko, document.head.appendChild(x);
|
|
1755
1799
|
}
|
|
1756
|
-
|
|
1800
|
+
f = !0;
|
|
1757
1801
|
}
|
|
1758
1802
|
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." :
|
|
1803
|
+
const C = t.token ?? (n == null ? void 0 : n.token), x = t.endpoint ?? (n == null ? void 0 : n.endpoint);
|
|
1804
|
+
if (!t.publishedKey || !C) {
|
|
1805
|
+
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
1806
|
return;
|
|
1763
1807
|
}
|
|
1764
|
-
const
|
|
1765
|
-
if (l ===
|
|
1808
|
+
const O = `${t.publishedKey}|${C}`;
|
|
1809
|
+
if (l === O && i.value) {
|
|
1766
1810
|
u();
|
|
1767
1811
|
return;
|
|
1768
1812
|
}
|
|
1769
1813
|
r == null || r.abort(), r = new AbortController();
|
|
1770
|
-
const
|
|
1771
|
-
l =
|
|
1772
|
-
const
|
|
1773
|
-
fetch(
|
|
1814
|
+
const X = r.signal;
|
|
1815
|
+
l = O, o.value = !0, s.value = null;
|
|
1816
|
+
const Ue = $e({ publishedKey: t.publishedKey, token: C, endpoint: x });
|
|
1817
|
+
fetch(Ue, {
|
|
1774
1818
|
method: "GET",
|
|
1775
1819
|
headers: { "Content-Type": "application/json" },
|
|
1776
|
-
...
|
|
1777
|
-
signal:
|
|
1778
|
-
}).then(async (
|
|
1779
|
-
if (
|
|
1780
|
-
const
|
|
1781
|
-
|
|
1820
|
+
...L(C) ? { cache: "no-store" } : {},
|
|
1821
|
+
signal: X
|
|
1822
|
+
}).then(async (E) => {
|
|
1823
|
+
if (E.ok) {
|
|
1824
|
+
const K = await E.json();
|
|
1825
|
+
K.success ? (i.value = Ke(K.data), s.value = null, u(), p()) : (s.value = "Failed to fetch widget data", i.value = null);
|
|
1782
1826
|
} else {
|
|
1783
|
-
const
|
|
1784
|
-
s.value =
|
|
1827
|
+
const K = await E.json().catch(() => ({ error: "Unknown error" }));
|
|
1828
|
+
s.value = K.error || `Request failed with status ${E.status}`, i.value = null;
|
|
1785
1829
|
}
|
|
1786
|
-
}).catch((
|
|
1787
|
-
|
|
1830
|
+
}).catch((E) => {
|
|
1831
|
+
E instanceof DOMException && E.name === "AbortError" || (console.error("Error fetching widget:", E), s.value = "Failed to fetch widget", i.value = null);
|
|
1788
1832
|
}).finally(() => {
|
|
1789
1833
|
o.value = !1;
|
|
1790
1834
|
});
|
|
1791
1835
|
}
|
|
1792
|
-
function
|
|
1836
|
+
function v() {
|
|
1793
1837
|
if (t.mode === "pre-fetched") {
|
|
1794
|
-
i.value = t.initialData ?? null, o.value = !1, s.value = null, u(),
|
|
1838
|
+
i.value = t.initialData ?? null, o.value = !1, s.value = null, u(), p();
|
|
1795
1839
|
return;
|
|
1796
1840
|
}
|
|
1797
1841
|
h(), g();
|
|
1798
1842
|
}
|
|
1799
|
-
return
|
|
1843
|
+
return De(
|
|
1800
1844
|
() => [
|
|
1801
1845
|
t.publishedKey,
|
|
1802
1846
|
t.token,
|
|
@@ -1807,54 +1851,54 @@ const Co = {
|
|
|
1807
1851
|
t.componentProps
|
|
1808
1852
|
],
|
|
1809
1853
|
() => {
|
|
1810
|
-
|
|
1854
|
+
v();
|
|
1811
1855
|
},
|
|
1812
1856
|
{ immediate: !0 }
|
|
1813
|
-
),
|
|
1857
|
+
), xe(() => {
|
|
1814
1858
|
r == null || r.abort();
|
|
1815
|
-
}), (
|
|
1859
|
+
}), (C, x) => (y(), b("span", {
|
|
1816
1860
|
"data-rulecms-published-key": e.publishedKey,
|
|
1817
1861
|
style: { display: "contents" }
|
|
1818
1862
|
}, [
|
|
1819
|
-
e.mode !== "pre-fetched" && o.value ? (
|
|
1863
|
+
e.mode !== "pre-fetched" && o.value ? (y(), b("div", {
|
|
1820
1864
|
key: 0,
|
|
1821
|
-
style: S(
|
|
1865
|
+
style: S(T(Ao))
|
|
1822
1866
|
}, [
|
|
1823
1867
|
$("div", {
|
|
1824
|
-
style: S(
|
|
1868
|
+
style: S(T(So))
|
|
1825
1869
|
}, [
|
|
1826
1870
|
$("div", {
|
|
1827
|
-
style: S(
|
|
1871
|
+
style: S(T(Io))
|
|
1828
1872
|
}, null, 4)
|
|
1829
1873
|
], 4)
|
|
1830
|
-
], 4)) : e.mode !== "pre-fetched" && s.value ? (
|
|
1874
|
+
], 4)) : e.mode !== "pre-fetched" && s.value ? (y(), b("div", {
|
|
1831
1875
|
key: 1,
|
|
1832
|
-
style: S(
|
|
1876
|
+
style: S(T(Se))
|
|
1833
1877
|
}, [
|
|
1834
1878
|
$("div", {
|
|
1835
|
-
style: S(
|
|
1879
|
+
style: S(T(Ie))
|
|
1836
1880
|
}, "Error Loading Widget", 4),
|
|
1837
1881
|
$("div", {
|
|
1838
|
-
style: S(
|
|
1839
|
-
},
|
|
1840
|
-
], 4)) : e.mode !== "pre-fetched" && !i.value ? (
|
|
1882
|
+
style: S(T(ke))
|
|
1883
|
+
}, Y(s.value), 5)
|
|
1884
|
+
], 4)) : e.mode !== "pre-fetched" && !i.value ? (y(), b("div", {
|
|
1841
1885
|
key: 2,
|
|
1842
|
-
style: S(
|
|
1886
|
+
style: S(T(Se))
|
|
1843
1887
|
}, [
|
|
1844
1888
|
$("div", {
|
|
1845
|
-
style: S(
|
|
1889
|
+
style: S(T(Ie))
|
|
1846
1890
|
}, "No Widget Data", 4),
|
|
1847
1891
|
$("div", {
|
|
1848
|
-
style: S(
|
|
1892
|
+
style: S(T(ke))
|
|
1849
1893
|
}, "No widget data available", 4)
|
|
1850
|
-
], 4)) : c.value && i.value ? (
|
|
1851
|
-
|
|
1894
|
+
], 4)) : c.value && i.value ? (y(), b(I, { key: 3 }, [
|
|
1895
|
+
d.value ? (y(), A(fo, {
|
|
1852
1896
|
key: 0,
|
|
1853
1897
|
"display-item-list": i.value.displayItemList,
|
|
1854
1898
|
"widget-collections": i.value.widgetCollections,
|
|
1855
1899
|
plugins: a.value,
|
|
1856
1900
|
"component-props": e.componentProps
|
|
1857
|
-
}, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props"])) : (
|
|
1901
|
+
}, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props"])) : (y(), A(ho, {
|
|
1858
1902
|
key: 1,
|
|
1859
1903
|
"display-item-list": i.value.displayItemList,
|
|
1860
1904
|
"is-compose-mode": !1,
|
|
@@ -1865,186 +1909,186 @@ const Co = {
|
|
|
1865
1909
|
plugins: a.value,
|
|
1866
1910
|
"component-props": e.componentProps
|
|
1867
1911
|
}, null, 8, ["display-item-list", "widget-collections", "plugins", "component-props"]))
|
|
1868
|
-
], 64)) :
|
|
1869
|
-
], 8,
|
|
1912
|
+
], 64)) : W("", !0)
|
|
1913
|
+
], 8, Do));
|
|
1870
1914
|
}
|
|
1871
1915
|
});
|
|
1872
|
-
class
|
|
1916
|
+
class H extends Error {
|
|
1873
1917
|
constructor(n, o) {
|
|
1874
1918
|
super(n);
|
|
1875
|
-
|
|
1919
|
+
me(this, "status");
|
|
1876
1920
|
this.name = "FetchRuleCMSWidgetError", this.status = o;
|
|
1877
1921
|
}
|
|
1878
1922
|
}
|
|
1879
|
-
async function
|
|
1923
|
+
async function Ho(e) {
|
|
1880
1924
|
const { publishedKey: t, token: n, endpoint: o, fetchOptions: s } = e;
|
|
1881
1925
|
if (!t)
|
|
1882
|
-
throw new
|
|
1883
|
-
|
|
1926
|
+
throw new H(
|
|
1927
|
+
L(n) ? "Widget key is required" : "Published key is required"
|
|
1884
1928
|
);
|
|
1885
1929
|
if (!n)
|
|
1886
|
-
throw new
|
|
1887
|
-
const i =
|
|
1930
|
+
throw new H("Token is required");
|
|
1931
|
+
const i = $e({ publishedKey: t, token: n, endpoint: o }), c = await fetch(i, {
|
|
1888
1932
|
method: "GET",
|
|
1889
1933
|
headers: { "Content-Type": "application/json" },
|
|
1890
|
-
...
|
|
1934
|
+
...L(n) ? { cache: "no-store" } : {},
|
|
1891
1935
|
...s
|
|
1892
1936
|
});
|
|
1893
1937
|
if (!c.ok) {
|
|
1894
1938
|
const a = await c.json().catch(() => ({ error: "Unknown error" }));
|
|
1895
|
-
throw new
|
|
1939
|
+
throw new H(
|
|
1896
1940
|
a.error || `Request failed with status ${c.status}`,
|
|
1897
1941
|
c.status
|
|
1898
1942
|
);
|
|
1899
1943
|
}
|
|
1900
|
-
const
|
|
1901
|
-
if (!
|
|
1902
|
-
throw new
|
|
1903
|
-
return
|
|
1944
|
+
const d = await c.json();
|
|
1945
|
+
if (!d.success)
|
|
1946
|
+
throw new H("Failed to fetch widget data");
|
|
1947
|
+
return Ke(d.data);
|
|
1904
1948
|
}
|
|
1905
|
-
async function
|
|
1906
|
-
const { data: t, libraries: n } = e, o =
|
|
1949
|
+
async function Go(e) {
|
|
1950
|
+
const { data: t, libraries: n } = e, o = le({
|
|
1907
1951
|
displayItemList: t.displayItemList,
|
|
1908
1952
|
widgetCollections: t.widgetCollections
|
|
1909
1953
|
});
|
|
1910
|
-
return
|
|
1954
|
+
return q().resolve({ registrations: n, referenced: o });
|
|
1911
1955
|
}
|
|
1912
1956
|
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
|
-
|
|
1957
|
+
Eo as AlignContentTypes,
|
|
1958
|
+
fo as BreakpointVariantRender,
|
|
1959
|
+
Ee as COLLECTION_TYPE_PREFIX,
|
|
1960
|
+
ye as COMPONENT_PROPS_PATH_SEPARATOR,
|
|
1961
|
+
pe as CSS_CLASSES_ATTRIBUTE_NAME,
|
|
1962
|
+
_t as CSS_VARIABLE_NAME_MAX_LENGTH,
|
|
1963
|
+
Wt as CSS_VARIABLE_NAME_PATTERN,
|
|
1964
|
+
bt as DEFAULT_CLOUDINARY_CLOUD_NAME,
|
|
1965
|
+
V as DEFAULT_LIBRARY_ID,
|
|
1966
|
+
Rn as DEFAULT_ROW_GAP,
|
|
1967
|
+
ot as DEV_CLIENT_TOKEN_PREFIX,
|
|
1968
|
+
lt as DEV_WIDGET_API_PATH,
|
|
1969
|
+
$o as DeviceDisplayTypes,
|
|
1970
|
+
uo as DisplayComponent,
|
|
1971
|
+
re as DisplayItemTypes,
|
|
1972
|
+
Pe as DragItemIdPrefixTypes,
|
|
1973
|
+
yt as EMBEDDED_KEY_SEPARATOR,
|
|
1974
|
+
rn as FLEX_LAYOUT_STYLE_KEYS_THAT_DERIVE_DISPLAY,
|
|
1975
|
+
H as FetchRuleCMSWidgetError,
|
|
1976
|
+
Oe as HIDE_WIDGET_ATTRIBUTE_NAME,
|
|
1977
|
+
we as JustifyContentTypes,
|
|
1978
|
+
ft as PUBLISHED_KEY_SEPARATOR,
|
|
1979
|
+
rt as PUBLISHED_WIDGET_API_PATH,
|
|
1980
|
+
Po as PageViewTypes,
|
|
1981
|
+
st as RULECMS_API_ORIGIN,
|
|
1982
|
+
Ko as RULECMS_PUBLISHED_KEY_ATTRIBUTE,
|
|
1983
|
+
Me as RULECMS_WIDGET_CONTEXT_KEY,
|
|
1984
|
+
ho as RenderComponents,
|
|
1985
|
+
oe as RenderComponentsForDevice,
|
|
1986
|
+
po as RenderComponentsInner,
|
|
1987
|
+
Uo as RuleCMSWidget,
|
|
1988
|
+
jo as RuleCMSWidgetProvider,
|
|
1989
|
+
On as WIDGET_ATTRIBUTES_IGNORED_IN_COMPOSE_MODE,
|
|
1990
|
+
it as WIDGET_CACHE_API_ORIGIN,
|
|
1991
|
+
en as alignContentAllowlist,
|
|
1992
|
+
Jt as alignItemsAllowlist,
|
|
1993
|
+
on as backgroundPositionAllowlist,
|
|
1994
|
+
sn as backgroundRepeatAllowlist,
|
|
1995
|
+
nn as backgroundSizeAllowlist,
|
|
1996
|
+
ln as borderStyleKeywords,
|
|
1997
|
+
Bt as boxSpacingSideKeys,
|
|
1998
|
+
Vo as boxSpacingStyleAttributeEntries,
|
|
1999
|
+
Nt as buildCloudinaryBackgroundUrl,
|
|
2000
|
+
$e as buildWidgetFetchUrl,
|
|
2001
|
+
Un as collectComponentInstancePaths,
|
|
2002
|
+
le as collectReferencedLibraryIds,
|
|
2003
|
+
nt as composeSourceComponentsPlugin,
|
|
2004
|
+
q as createComponentLibraryRegistry,
|
|
2005
|
+
Q as cssAttrArrayKey,
|
|
2006
|
+
ht as defaultPageWidth,
|
|
2007
|
+
Tn as deriveDisplayFlexIfNeeded,
|
|
2008
|
+
Bo as desktopModeWidth,
|
|
2009
|
+
Ho as fetchRuleCMSWidget,
|
|
2010
|
+
Gn as findUnmatchedComponentPropsKeys,
|
|
2011
|
+
tn as flexDirectionAllowlist,
|
|
2012
|
+
Qt as flexWrapAllowlist,
|
|
2013
|
+
Ht as fontFamilyAllowlist,
|
|
2014
|
+
zt as fontStyleAllowlist,
|
|
2015
|
+
Gt as fontWeightAllowlist,
|
|
2016
|
+
gn as formatBackgroundImageStyles,
|
|
2017
|
+
hn as formatBorderStyles,
|
|
2018
|
+
bn as formatBoxShadowStyles,
|
|
2019
|
+
Cn as formatBoxSpacingStyles,
|
|
2020
|
+
vn as formatCssColorStyles,
|
|
2021
|
+
ue as formatCssColorValue,
|
|
2022
|
+
An as formatCssEnumStyles,
|
|
2023
|
+
Sn as formatCssLengthStyles,
|
|
2024
|
+
k as formatCssVariable,
|
|
2025
|
+
Fo as formatCssVariableStyles,
|
|
2026
|
+
In as formatLineHeightStyles,
|
|
2027
|
+
Dn as formatObjectStyleAttribute,
|
|
2028
|
+
kn as formatOpacityStyles,
|
|
2029
|
+
N as formatSpacingSideValue,
|
|
2030
|
+
mt as generatePublishedKey,
|
|
2031
|
+
_o as generatePublishedKeyForEmbedded,
|
|
2032
|
+
Le as getCollectionIdForCollectionType,
|
|
2033
|
+
G as getColumnAttributes,
|
|
2034
|
+
Ce as getComponentAttributesAndStyles,
|
|
2035
|
+
te as getComponentsPluginFromPlugins,
|
|
2036
|
+
w as getCssVariableFromLeaf,
|
|
2037
|
+
Pn as getDefaultDimensionAttributes,
|
|
2038
|
+
_ as getDeviceTypeBasedAttributes,
|
|
2039
|
+
Ro as getDragItemId,
|
|
2040
|
+
at as getDragItemPrefixAndId,
|
|
2041
|
+
ut as getIdAndPrefix,
|
|
2042
|
+
En as getMergedAttributes,
|
|
2043
|
+
Lo as getNameAndInstanceIdFromWidgetKey,
|
|
2044
|
+
Mo as getNameFromWidgetKey,
|
|
2045
|
+
dt as getWidgetKeyForCollection,
|
|
2046
|
+
No as getWidgetKeyForCollectionWithPrefix,
|
|
2047
|
+
pt as getWidgetKeyForPublishedCollection,
|
|
2048
|
+
Wo as getWidgetKeyForPublishedCollectionWithPrefix,
|
|
2049
|
+
fn as hasBoxShadowLeaf,
|
|
2050
|
+
Xn as hasDeviceDivergentValues,
|
|
2051
|
+
P as hasInvalidCssVariable,
|
|
2052
|
+
$n as hasItems,
|
|
2053
|
+
Oo as incrementVersion,
|
|
2054
|
+
Ot as isBackgroundImageValue,
|
|
2055
|
+
cn as isBorderStyleValue,
|
|
2056
|
+
an as isBorderValue,
|
|
2057
|
+
pn as isBoxShadowValue,
|
|
2058
|
+
Ft as isBoxSpacingValue,
|
|
2059
|
+
Et as isCloudinaryCloudName,
|
|
2060
|
+
Pt as isCloudinaryPublicId,
|
|
2061
|
+
Rt as isCloudinaryTransformationString,
|
|
2062
|
+
ae as isCssColorValue,
|
|
2063
|
+
Ut as isCssEnumValue,
|
|
2064
|
+
_e as isCssVariableName,
|
|
2065
|
+
L as isDevClientToken,
|
|
2066
|
+
yn as isLineHeightValue,
|
|
2067
|
+
mn as isOpacityValue,
|
|
2068
|
+
Mn as isRowHiddenForDevice,
|
|
2069
|
+
$t as isSafeImageUrl,
|
|
2070
|
+
M as isSpacingSideValue,
|
|
2071
|
+
Bn as isWidgetHiddenForDevice,
|
|
2072
|
+
Zt as justifyContentAllowlist,
|
|
2073
|
+
fe as normalizeCssClasses,
|
|
2074
|
+
de as objectStyleAttributeRegistry,
|
|
2075
|
+
ee as overflowAllowlist,
|
|
2076
|
+
Ne as phoneModeWidth,
|
|
2077
|
+
Ke as prepareRuleCMSWidgetData,
|
|
2078
|
+
Te as resolveKey,
|
|
2079
|
+
Nn as resolveRowStyles,
|
|
2080
|
+
ct as resolveWidgetApiOrigin,
|
|
2081
|
+
Fn as resolveWidgetContainerStyles,
|
|
2082
|
+
Kn as resolveWidgetInstanceProps,
|
|
2083
|
+
Go as resolveWidgetLibraries,
|
|
2084
|
+
Ln as rowBasedPropertiesAreAssigned,
|
|
2085
|
+
ce as spacingKeywords,
|
|
2086
|
+
jt as spacingLengthUnits,
|
|
2087
|
+
We as tabletModeWidth,
|
|
2088
|
+
Yt as textAlignAllowlist,
|
|
2089
|
+
qt as textDecorationAllowlist,
|
|
2090
|
+
Xt as textTransformAllowlist,
|
|
2091
|
+
Re as typeHasPrefix,
|
|
2092
|
+
zn as warnUnmatchedComponentProps,
|
|
2093
|
+
Vn as widgetBasedPropertiesAreAssigned
|
|
2050
2094
|
};
|