@proximus/lavender-common 1.4.15-beta.1 → 1.4.16-alpha.3

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.
@@ -0,0 +1 @@
1
+ (function(){var e=`.mgnlEditor`,t={"PX-HEADER":`editor`};function n(e){return!!e.shadowRoot?.querySelector(`slot:not([name])`)}function r(e,t){return t[e.tagName]??null}function i(i,{selector:a=e,slotByHost:o=t}={}){if(!i.matches(a)||i.hasAttribute(`slot`))return null;let s=i.parentElement;if(!s?.shadowRoot||n(s))return null;let c=r(s,o);return c?(i.setAttribute(`slot`,c),c):null}function a({selector:n=e,slotByHost:r=t,root:a=document.documentElement}={}){let o=0;return a.querySelectorAll(n).forEach(e=>{i(e,{selector:n,slotByHost:r})&&(o+=1)}),o}function o({selector:n=e,slotByHost:r=t,root:o=document.documentElement}={}){a({selector:n,slotByHost:r,root:o});let s=new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&(i(e,{selector:n,slotByHost:r}),e.querySelectorAll(n).forEach(e=>{i(e,{selector:n,slotByHost:r})}))})})});return s.observe(o,{childList:!0,subtree:!0}),()=>s.disconnect()}function s(){window.pxCmsEditorSlotsStop=o(window.pxCmsEditorSlots)}document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,s,{once:!0}):s()})();
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Standalone, side-effecting entry point for the CMS authoring chrome shim.
3
+ *
4
+ * Built to `dist/cms-editor-slots.js` as a classic script, so it can be dropped
5
+ * into a CMS author instance with a plain tag, without any bundler:
6
+ *
7
+ * ```html
8
+ * <script src="/.resources/lavender/cms-editor-slots.js"></script>
9
+ * ```
10
+ *
11
+ * In Magnolia, guard the include so it never reaches a public page:
12
+ *
13
+ * ```ftl
14
+ * [#if cmsfn.editMode]
15
+ * <script src="${ctx.contextPath}/.resources/lavender/cms-editor-slots.js"></script>
16
+ * [/#if]
17
+ * ```
18
+ *
19
+ * The host to slot mapping can be extended before the script runs:
20
+ *
21
+ * ```html
22
+ * <script>
23
+ * window.pxCmsEditorSlots = { slotByHost: { 'PX-HEADER': 'editor' } };
24
+ * </script>
25
+ * <script src="/.resources/lavender/cms-editor-slots.js"></script>
26
+ * ```
27
+ *
28
+ * Import `observeCmsEditorSlots` from `@proximus/lavender-common` instead when
29
+ * you drive the integration from your own bundle.
30
+ */
31
+ import { type CmsEditorSlotsOptions } from './cmsEditorSlots';
32
+ declare global {
33
+ interface Window {
34
+ /** Optional configuration, read once when the standalone script runs. */
35
+ pxCmsEditorSlots?: CmsEditorSlotsOptions;
36
+ /** Disconnects the observer started by the standalone script. */
37
+ pxCmsEditorSlotsStop?: () => void;
38
+ }
39
+ }
@@ -0,0 +1,60 @@
1
+ /**
2
+ * CMS authoring chrome slot assignment.
3
+ *
4
+ * A CMS page editor injects its controls (edit bars, placeholders, drop zones)
5
+ * next to the markers it rendered server side. Magnolia, for instance, emits
6
+ * `cms:area` / `cms:component` HTML comments and, client side, inserts a
7
+ * `div.mgnlEditorBar` as a sibling of each comment.
8
+ *
9
+ * When such a comment sits inside a Lavender custom element, the injected
10
+ * control becomes a direct child of a shadow host. Shadow DOM only projects
11
+ * children that match a slot, and most Lavender components expose named slots
12
+ * only, with no default `<slot>`. The control therefore stays in the DOM but is
13
+ * never rendered, and the authoring UI silently disappears.
14
+ *
15
+ * These helpers assign the injected elements to a slot the host actually
16
+ * exposes, for example the `editor` slot of `px-header`.
17
+ *
18
+ * They are meant to run on an author instance only, never on a public page.
19
+ */
20
+ /** Maps a host tag name to the slot its authoring chrome should be assigned to. */
21
+ export type CmsEditorSlotMap = Record<string, string>;
22
+ export interface CmsEditorSlotsOptions {
23
+ /**
24
+ * Selector matching the elements injected by the page editor.
25
+ * Defaults to Magnolia's `.mgnlEditor` marker class.
26
+ */
27
+ selector?: string;
28
+ /**
29
+ * Slot name to use per host tag name. Tag names are matched upper case, the
30
+ * way `Element.tagName` reports them.
31
+ */
32
+ slotByHost?: CmsEditorSlotMap;
33
+ /** Root to scan and observe. Defaults to `document.documentElement`. */
34
+ root?: ParentNode & Node;
35
+ }
36
+ /**
37
+ * Assigns a single element to the slot of its host when it would otherwise stay
38
+ * unprojected.
39
+ *
40
+ * Nothing happens when the element already carries a `slot` attribute, when its
41
+ * parent is not a shadow host, or when that host exposes a default `<slot>`,
42
+ * since in that case the element is projected already.
43
+ *
44
+ * @returns the slot name that was applied, or `null` when the element was left
45
+ * untouched.
46
+ */
47
+ export declare function assignCmsEditorSlot(element: Element, { selector, slotByHost, }?: Omit<CmsEditorSlotsOptions, 'root'>): string | null;
48
+ /**
49
+ * Assigns every already injected control found under `root`.
50
+ *
51
+ * @returns the number of elements that were assigned to a slot.
52
+ */
53
+ export declare function assignCmsEditorSlots({ selector, slotByHost, root, }?: CmsEditorSlotsOptions): number;
54
+ /**
55
+ * Assigns the controls already present, then keeps watching for the ones the
56
+ * page editor injects later, after a save or a selection change.
57
+ *
58
+ * @returns a function disconnecting the observer.
59
+ */
60
+ export declare function observeCmsEditorSlots({ selector, slotByHost, root, }?: CmsEditorSlotsOptions): () => void;
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './common';
2
2
  export * from './breakpoints';
3
+ export * from './cmsEditorSlots';
package/dist/index.es.js CHANGED
@@ -155,235 +155,235 @@ var u = class e extends HTMLElement {
155
155
  return this.getAttribute("grow");
156
156
  }
157
157
  set grow(e) {
158
- G(this, "grow", e);
158
+ W(this, "grow", e);
159
159
  }
160
160
  get growMobile() {
161
161
  return this.getAttribute("grow--mobile");
162
162
  }
163
163
  set growMobile(e) {
164
- G(this, "grow--mobile", e);
164
+ W(this, "grow--mobile", e);
165
165
  }
166
166
  get growTablet() {
167
167
  return this.getAttribute("grow--tablet");
168
168
  }
169
169
  set growTablet(e) {
170
- G(this, "grow--tablet", e);
170
+ W(this, "grow--tablet", e);
171
171
  }
172
172
  get growLaptop() {
173
173
  return this.getAttribute("grow--laptop");
174
174
  }
175
175
  set growLaptop(e) {
176
- G(this, "grow--laptop", e);
176
+ W(this, "grow--laptop", e);
177
177
  }
178
178
  get growDesktop() {
179
179
  return this.getAttribute("grow--desktop");
180
180
  }
181
181
  set growDesktop(e) {
182
- G(this, "grow--desktop", e);
182
+ W(this, "grow--desktop", e);
183
183
  }
184
184
  get shrink() {
185
185
  return this.getAttribute("shrink");
186
186
  }
187
187
  set shrink(e) {
188
- G(this, "shrink", e);
188
+ W(this, "shrink", e);
189
189
  }
190
190
  get shrinkMobile() {
191
191
  return this.getAttribute("shrink--mobile");
192
192
  }
193
193
  set shrinkMobile(e) {
194
- G(this, "shrink--mobile", e);
194
+ W(this, "shrink--mobile", e);
195
195
  }
196
196
  get shrinkTablet() {
197
197
  return this.getAttribute("shrink--tablet");
198
198
  }
199
199
  set shrinkTablet(e) {
200
- G(this, "shrink--tablet", e);
200
+ W(this, "shrink--tablet", e);
201
201
  }
202
202
  get shrinkLaptop() {
203
203
  return this.getAttribute("shrink--laptop");
204
204
  }
205
205
  set shrinkLaptop(e) {
206
- G(this, "shrink--laptop", e);
206
+ W(this, "shrink--laptop", e);
207
207
  }
208
208
  get shrinkDesktop() {
209
209
  return this.getAttribute("shrink--desktop");
210
210
  }
211
211
  set shrinkDesktop(e) {
212
- G(this, "shrink--desktop", e);
212
+ W(this, "shrink--desktop", e);
213
213
  }
214
214
  get basis() {
215
215
  return this.getAttribute("basis");
216
216
  }
217
217
  set basis(e) {
218
- G(this, "basis", e);
218
+ W(this, "basis", e);
219
219
  }
220
220
  get basisMobile() {
221
221
  return this.getAttribute("basis--mobile");
222
222
  }
223
223
  set basisMobile(e) {
224
- G(this, "basis--mobile", e);
224
+ W(this, "basis--mobile", e);
225
225
  }
226
226
  get basisTablet() {
227
227
  return this.getAttribute("basis--tablet");
228
228
  }
229
229
  set basisTablet(e) {
230
- G(this, "basis--tablet", e);
230
+ W(this, "basis--tablet", e);
231
231
  }
232
232
  get basisLaptop() {
233
233
  return this.getAttribute("basis--laptop");
234
234
  }
235
235
  set basisLaptop(e) {
236
- G(this, "basis--laptop", e);
236
+ W(this, "basis--laptop", e);
237
237
  }
238
238
  get basisDesktop() {
239
239
  return this.getAttribute("basis--desktop");
240
240
  }
241
241
  set basisDesktop(e) {
242
- G(this, "basis--desktop", e);
242
+ W(this, "basis--desktop", e);
243
243
  }
244
244
  get alignSelf() {
245
245
  return this.getAttribute("align-self");
246
246
  }
247
247
  set alignSelf(e) {
248
- G(this, "align-self", e);
248
+ W(this, "align-self", e);
249
249
  }
250
250
  get alignSelfMobile() {
251
251
  return this.getAttribute("align-self--mobile");
252
252
  }
253
253
  set alignSelfMobile(e) {
254
- G(this, "align-self--mobile", e);
254
+ W(this, "align-self--mobile", e);
255
255
  }
256
256
  get alignSelfTablet() {
257
257
  return this.getAttribute("align-self--tablet");
258
258
  }
259
259
  set alignSelfTablet(e) {
260
- G(this, "align-self--tablet", e);
260
+ W(this, "align-self--tablet", e);
261
261
  }
262
262
  get alignSelfLaptop() {
263
263
  return this.getAttribute("align-self--laptop");
264
264
  }
265
265
  set alignSelfLaptop(e) {
266
- G(this, "align-self--laptop", e);
266
+ W(this, "align-self--laptop", e);
267
267
  }
268
268
  get alignSelfDesktop() {
269
269
  return this.getAttribute("align-self--desktop");
270
270
  }
271
271
  set alignSelfDesktop(e) {
272
- G(this, "align-self--desktop", e);
272
+ W(this, "align-self--desktop", e);
273
273
  }
274
274
  get justifySelf() {
275
275
  return this.getAttribute("justify-self");
276
276
  }
277
277
  set justifySelf(e) {
278
- G(this, "justify-self", e);
278
+ W(this, "justify-self", e);
279
279
  }
280
280
  get justifySelfMobile() {
281
281
  return this.getAttribute("justify-self--mobile");
282
282
  }
283
283
  set justifySelfMobile(e) {
284
- G(this, "justify-self--mobile", e);
284
+ W(this, "justify-self--mobile", e);
285
285
  }
286
286
  get justifySelfTablet() {
287
287
  return this.getAttribute("justify-self--tablet");
288
288
  }
289
289
  set justifySelfTablet(e) {
290
- G(this, "justify-self--tablet", e);
290
+ W(this, "justify-self--tablet", e);
291
291
  }
292
292
  get justifySelfLaptop() {
293
293
  return this.getAttribute("justify-self--laptop");
294
294
  }
295
295
  set justifySelfLaptop(e) {
296
- G(this, "justify-self--laptop", e);
296
+ W(this, "justify-self--laptop", e);
297
297
  }
298
298
  get justifySelfDesktop() {
299
299
  return this.getAttribute("justify-self--desktop");
300
300
  }
301
301
  set justifySelfDesktop(e) {
302
- G(this, "justify-self--desktop", e);
302
+ W(this, "justify-self--desktop", e);
303
303
  }
304
304
  get hiddenMobile() {
305
305
  return this.hasAttribute("hidden--mobile");
306
306
  }
307
307
  set hiddenMobile(e) {
308
- K(this, "hidden--mobile", e);
308
+ G(this, "hidden--mobile", e);
309
309
  }
310
310
  get hiddenTablet() {
311
311
  return this.hasAttribute("hidden--tablet");
312
312
  }
313
313
  set hiddenTablet(e) {
314
- K(this, "hidden--tablet", e);
314
+ G(this, "hidden--tablet", e);
315
315
  }
316
316
  get hiddenLaptop() {
317
317
  return this.hasAttribute("hidden--laptop");
318
318
  }
319
319
  set hiddenLaptop(e) {
320
- K(this, "hidden--laptop", e);
320
+ G(this, "hidden--laptop", e);
321
321
  }
322
322
  get hiddenDesktop() {
323
323
  return this.hasAttribute("hidden--desktop");
324
324
  }
325
325
  set hiddenDesktop(e) {
326
- K(this, "hidden--desktop", e);
326
+ G(this, "hidden--desktop", e);
327
327
  }
328
328
  get colSpan() {
329
329
  return this.getAttribute("col-span");
330
330
  }
331
331
  set colSpan(e) {
332
- G(this, "col-span", e);
332
+ W(this, "col-span", e);
333
333
  }
334
334
  get colSpanMobile() {
335
335
  return this.getAttribute("col-span--mobile");
336
336
  }
337
337
  set colSpanMobile(e) {
338
- G(this, "col-span--mobile", e);
338
+ W(this, "col-span--mobile", e);
339
339
  }
340
340
  get colSpanTablet() {
341
341
  return this.getAttribute("col-span--tablet");
342
342
  }
343
343
  set colSpanTablet(e) {
344
- G(this, "col-span--tablet", e);
344
+ W(this, "col-span--tablet", e);
345
345
  }
346
346
  get colSpanLaptop() {
347
347
  return this.getAttribute("col-span--laptop");
348
348
  }
349
349
  set colSpanLaptop(e) {
350
- G(this, "col-span--laptop", e);
350
+ W(this, "col-span--laptop", e);
351
351
  }
352
352
  get colSpanDesktop() {
353
353
  return this.getAttribute("col-span--desktop");
354
354
  }
355
355
  set colSpanDesktop(e) {
356
- G(this, "col-span--desktop", e);
356
+ W(this, "col-span--desktop", e);
357
357
  }
358
358
  get order() {
359
359
  return this.getAttribute("order");
360
360
  }
361
361
  set order(e) {
362
- G(this, "order", e);
362
+ W(this, "order", e);
363
363
  }
364
364
  get orderMobile() {
365
365
  return this.getAttribute("order--mobile");
366
366
  }
367
367
  set orderMobile(e) {
368
- G(this, "order--mobile", e);
368
+ W(this, "order--mobile", e);
369
369
  }
370
370
  get orderTablet() {
371
371
  return this.getAttribute("order--tablet");
372
372
  }
373
373
  set orderTablet(e) {
374
- G(this, "order--tablet", e);
374
+ W(this, "order--tablet", e);
375
375
  }
376
376
  get orderLaptop() {
377
377
  return this.getAttribute("order--laptop");
378
378
  }
379
379
  set orderLaptop(e) {
380
- G(this, "order--laptop", e);
380
+ W(this, "order--laptop", e);
381
381
  }
382
382
  get orderDesktop() {
383
383
  return this.getAttribute("order--desktop");
384
384
  }
385
385
  set orderDesktop(e) {
386
- G(this, "order--desktop", e);
386
+ W(this, "order--desktop", e);
387
387
  }
388
388
  }, d = class extends u {
389
389
  static {
@@ -419,10 +419,10 @@ var u = class e extends HTMLElement {
419
419
  return this.shadowRoot.querySelector(this.ctor.nativeName);
420
420
  }
421
421
  _updateAttribute(e, t) {
422
- G(this, e, t);
422
+ W(this, e, t);
423
423
  }
424
424
  _updateBooleanAttribute(e, t) {
425
- K(this, e, t);
425
+ G(this, e, t);
426
426
  }
427
427
  }, f = class extends d {
428
428
  connectedCallback() {
@@ -541,17 +541,17 @@ var u = class e extends HTMLElement {
541
541
  "M",
542
542
  "L",
543
543
  "Xl"
544
- ], w = [
544
+ ], ee = [
545
545
  "",
546
546
  "default",
547
547
  ...C.map((e) => e.toLowerCase())
548
- ], T = [
548
+ ], w = [
549
549
  "",
550
550
  "default",
551
551
  "left",
552
552
  "center",
553
553
  "right"
554
- ], E = [
554
+ ], T = [
555
555
  "",
556
556
  "none",
557
557
  "3xs",
@@ -561,18 +561,18 @@ var u = class e extends HTMLElement {
561
561
  "m",
562
562
  "l",
563
563
  "xl"
564
- ], D = [
564
+ ], E = [
565
565
  "",
566
566
  "none",
567
567
  "s",
568
568
  "m",
569
569
  "l"
570
- ], O = [
570
+ ], D = [
571
571
  "",
572
572
  "none",
573
573
  "main",
574
574
  "pill"
575
- ], k = [
575
+ ], O = [
576
576
  "none",
577
577
  "main",
578
578
  "brand",
@@ -583,7 +583,7 @@ var u = class e extends HTMLElement {
583
583
  "purpose-warning",
584
584
  "purpose-error",
585
585
  "purpose-unlimited"
586
- ], A = [
586
+ ], k = [
587
587
  "",
588
588
  "all",
589
589
  "top",
@@ -592,19 +592,19 @@ var u = class e extends HTMLElement {
592
592
  "left",
593
593
  "block",
594
594
  "inline"
595
- ], j = /* @__PURE__ */ ".none.surface-light.surface-default.surface-strong.surface-stronger.surface-dark.surface-brand.surface-brand-light.container-primary.container-secondary.container-light.container-default.container-strong.state-hover.state-hover-bordered.state-active.state-disabled.purpose-success.purpose-warning.purpose-error.purpose-unlimited.purpose-promo.purpose-info.purpose-eco.purpose-notification.footer-sitemap".split("."), M = [
595
+ ], A = /* @__PURE__ */ ".none.surface-light.surface-default.surface-strong.surface-stronger.surface-dark.surface-brand.surface-brand-light.container-primary.container-secondary.container-light.container-default.container-strong.state-hover.state-hover-bordered.state-active.state-disabled.purpose-success.purpose-warning.purpose-error.purpose-unlimited.purpose-promo.purpose-info.purpose-eco.purpose-notification.footer-sitemap".split("."), j = [
596
596
  "",
597
597
  "cover",
598
598
  "contain",
599
599
  "default"
600
- ], N = [
600
+ ], M = [
601
601
  "",
602
602
  "none",
603
603
  "s",
604
604
  "m",
605
605
  "l",
606
606
  "xl"
607
- ], P = [
607
+ ], N = [
608
608
  "",
609
609
  "default",
610
610
  "title-4xl",
@@ -615,7 +615,7 @@ var u = class e extends HTMLElement {
615
615
  "title-m",
616
616
  "title-s",
617
617
  "subtitle"
618
- ], F = /* @__PURE__ */ ".purple-top-red.purple-top-magenta.purple-top-orange.purple-top-blue.purple-top-turquoise.purple-top-green.purple-right-red.purple-right-magenta.purple-right-orange.purple-right-blue.purple-right-turquoise.purple-right-green.purple-top-right-red.purple-top-right-magenta.purple-top-right-orange.purple-top-right-blue.purple-top-right-turquoise.purple-top-right-green.purple-bottom-right-red.purple-bottom-right-magenta.purple-bottom-right-orange.purple-bottom-right-blue.purple-bottom-right-turquoise.purple-bottom-right-green.color-top-red.color-top-magenta.color-top-orange.color-top-blue.color-top-turquoise.color-top-green.color-right-red.color-right-magenta.color-right-orange.color-right-blue.color-right-turquoise.color-right-green.color-top-right-red.color-top-right-magenta.color-top-right-orange.color-top-right-blue.color-top-right-turquoise.color-top-right-green.color-bottom-right-red.color-bottom-right-magenta.color-bottom-right-orange.color-bottom-right-blue.color-bottom-right-turquoise.color-bottom-right-green".split("."), I = [
618
+ ], P = /* @__PURE__ */ ".purple-top-red.purple-top-magenta.purple-top-orange.purple-top-blue.purple-top-turquoise.purple-top-green.purple-right-red.purple-right-magenta.purple-right-orange.purple-right-blue.purple-right-turquoise.purple-right-green.purple-top-right-red.purple-top-right-magenta.purple-top-right-orange.purple-top-right-blue.purple-top-right-turquoise.purple-top-right-green.purple-bottom-right-red.purple-bottom-right-magenta.purple-bottom-right-orange.purple-bottom-right-blue.purple-bottom-right-turquoise.purple-bottom-right-green.color-top-red.color-top-magenta.color-top-orange.color-top-blue.color-top-turquoise.color-top-green.color-right-red.color-right-magenta.color-right-orange.color-right-blue.color-right-turquoise.color-right-green.color-top-right-red.color-top-right-magenta.color-top-right-orange.color-top-right-blue.color-top-right-turquoise.color-top-right-green.color-bottom-right-red.color-bottom-right-magenta.color-bottom-right-orange.color-bottom-right-blue.color-bottom-right-turquoise.color-bottom-right-green".split("."), F = [
619
619
  "none",
620
620
  "2xs",
621
621
  "xs",
@@ -625,14 +625,14 @@ var u = class e extends HTMLElement {
625
625
  "heading-to-subtitle",
626
626
  "heading-to-content",
627
627
  "page-layout-between-sections"
628
- ], L = [
628
+ ], I = [
629
629
  "",
630
630
  "all",
631
631
  "top",
632
632
  "right",
633
633
  "bottom",
634
634
  "left"
635
- ], R = [
635
+ ], L = [
636
636
  "",
637
637
  "default",
638
638
  "xs",
@@ -641,36 +641,36 @@ var u = class e extends HTMLElement {
641
641
  "l",
642
642
  "xl"
643
643
  ];
644
- function z(e) {
644
+ function R(e) {
645
645
  let t = document.createElement("style");
646
646
  t.innerHTML = e, document.head.appendChild(t);
647
647
  }
648
- function B(e) {
648
+ function z(e) {
649
649
  return typeof e == "string" && (e === "false" || e === "0" || e === "null") || typeof e == "boolean" && !e;
650
650
  }
651
- function V() {
651
+ function B() {
652
652
  return window.matchMedia("only screen and (min-width: 768px)").matches ? "tablet" : window.matchMedia("only screen and (min-width: 1025px)").matches ? "laptop" : "mobile";
653
653
  }
654
- function H(e, t) {
654
+ function V(e, t) {
655
655
  return t !== null && e.includes(t);
656
656
  }
657
- var U = /* @__PURE__ */ "aria-label.aria-labelledby.aria-describedby.aria-controls.aria-expanded.aria-haspopup.aria-pressed.aria-selected.aria-required.aria-disabled.aria-live.aria-atomic.aria-relevant.aria-orientation.aria-valuenow.aria-valuetext.aria-valuemin.aria-valuemax.aria-details.aria-modal.aria-autocomplete.aria-activedescendant.aria-colcount.aria-colindex.aria-colspan.aria-rowcount.aria-rowindex.aria-rowspan.aria-keyshortcuts.aria-placeholder.aria-invalid.aria-busy.aria-owns".split(".");
658
- function W(e, t, n = !1) {
659
- if (U.forEach((n) => {
657
+ var H = /* @__PURE__ */ "aria-label.aria-labelledby.aria-describedby.aria-controls.aria-expanded.aria-haspopup.aria-pressed.aria-selected.aria-required.aria-disabled.aria-live.aria-atomic.aria-relevant.aria-orientation.aria-valuenow.aria-valuetext.aria-valuemin.aria-valuemax.aria-details.aria-modal.aria-autocomplete.aria-activedescendant.aria-colcount.aria-colindex.aria-colspan.aria-rowcount.aria-rowindex.aria-rowspan.aria-keyshortcuts.aria-placeholder.aria-invalid.aria-busy.aria-owns".split(".");
658
+ function U(e, t, n = !1) {
659
+ if (H.forEach((n) => {
660
660
  e.getAttribute(n) && (t.setAttribute(n, e.getAttribute(n)), e.removeAttribute(n));
661
661
  }), n && !e.getAttribute("aria-labelledby")) {
662
662
  let n = `px-${t.localName?.toLowerCase() ?? "component"}-${Math.random().toString(36).substring(2, 15)}`;
663
663
  t.setAttribute("id", n), e.setAttribute("aria-labelledby", n);
664
664
  }
665
665
  }
666
- function G(e, t, n) {
666
+ function W(e, t, n) {
667
667
  if (n == null || n === "") {
668
668
  e.removeAttribute(t);
669
669
  return;
670
670
  }
671
671
  e.setAttribute(t, n.toString());
672
672
  }
673
- function K(e, t, n) {
673
+ function G(e, t, n) {
674
674
  if (!n) {
675
675
  e.removeAttribute(t);
676
676
  return;
@@ -679,7 +679,7 @@ function K(e, t, n) {
679
679
  }
680
680
  //#endregion
681
681
  //#region src/breakpoints.ts
682
- function q(e, t, n, r = "", i, a = e) {
682
+ function K(e, t, n, r = "", i, a = e) {
683
683
  let o = new CSSStyleSheet(), s = n.reduce((n, o) => n + `
684
684
  ${t(a, o)} {
685
685
  ${e}: var(--${r}-${o}-desktop);
@@ -722,7 +722,7 @@ function q(e, t, n, r = "", i, a = e) {
722
722
  }`, "");
723
723
  return o.replaceSync(s), o;
724
724
  }
725
- var J = class {
725
+ var q = class {
726
726
  constructor(e, t, n, r) {
727
727
  this.component = e, this.attributeName = t, this.cssVariable = r, this.attributeNameMobile = `${this.attributeName}--mobile`, this.attributeNameTablet = `${this.attributeName}--tablet`, this.attributeNameLaptop = `${this.attributeName}--laptop`, this.attributeNameDesktop = `${this.attributeName}--desktop`, this._attributeValue = n, Object.defineProperty(this.component, this.toCamelCase(this.attributeName), {
728
728
  get: () => this.component.getAttribute(this.attributeName),
@@ -768,6 +768,54 @@ var J = class {
768
768
  set attributeValue(e) {
769
769
  this._attributeValue = e, this.setCSSProperties();
770
770
  }
771
- };
771
+ }, J = ".mgnlEditor", Y = { "PX-HEADER": "editor" };
772
+ function X(e) {
773
+ return !!e.shadowRoot?.querySelector("slot:not([name])");
774
+ }
775
+ function Z(e, t) {
776
+ return t[e.tagName] ?? null;
777
+ }
778
+ function Q(e, { selector: t = J, slotByHost: n = Y } = {}) {
779
+ if (!e.matches(t) || e.hasAttribute("slot")) return null;
780
+ let r = e.parentElement;
781
+ if (!r?.shadowRoot || X(r)) return null;
782
+ let i = Z(r, n);
783
+ return i ? (e.setAttribute("slot", i), i) : null;
784
+ }
785
+ function $({ selector: e = J, slotByHost: t = Y, root: n = document.documentElement } = {}) {
786
+ let r = 0;
787
+ return n.querySelectorAll(e).forEach((n) => {
788
+ Q(n, {
789
+ selector: e,
790
+ slotByHost: t
791
+ }) && (r += 1);
792
+ }), r;
793
+ }
794
+ function te({ selector: e = J, slotByHost: t = Y, root: n = document.documentElement } = {}) {
795
+ $({
796
+ selector: e,
797
+ slotByHost: t,
798
+ root: n
799
+ });
800
+ let r = new MutationObserver((n) => {
801
+ n.forEach((n) => {
802
+ n.addedNodes.forEach((n) => {
803
+ n instanceof Element && (Q(n, {
804
+ selector: e,
805
+ slotByHost: t
806
+ }), n.querySelectorAll(e).forEach((n) => {
807
+ Q(n, {
808
+ selector: e,
809
+ slotByHost: t
810
+ });
811
+ }));
812
+ });
813
+ });
814
+ });
815
+ return r.observe(n, {
816
+ childList: !0,
817
+ subtree: !0
818
+ }), () => r.disconnect();
819
+ }
772
820
  //#endregion
773
- export { J as AttributeBreakpointHandlerDelegate, d as PxElement, f as VerticallyExtendedElement, u as WithExtraAttributes, c as WrappedInteractiveStateController, U as accessibilityAttributes, z as addGlobalStylesheet, R as assetContainerImgWidthValues, j as backgroundColorValues, M as backgroundSizeValues, K as booleanPropertyToAttributeSetter, k as borderColorValues, O as borderRadiusValues, A as borderSideValues, D as borderValues, N as boxShadowValues, H as checkName, x as colorValues, h as cssGridAlignSelfValues, _ as cssGridColSpanValues, g as cssGridJustifySelfValues, v as cssGridOrderValues, y as cssGridPlaceSelfValues, q as cssTokenBreakpoints, m as flexboxAlignSelfValues, b as fontsizeValues, S as fontweightValues, I as gapValues, n as getSupportedAttributeNames, t as getSupportedPropertyNames, V as getViewportFormat, F as gradientValues, p as gridGapValues, P as headingValues, C as iconSizeValues, w as iconSizeValuesKC, o as isComponentDebug, B as isFalsy, s as log, L as noBorderRadiusValues, E as paddingValues, G as propertyToAttributeSetter, T as textalignValues, W as transferAccessibilityAttributes };
821
+ export { q as AttributeBreakpointHandlerDelegate, d as PxElement, f as VerticallyExtendedElement, u as WithExtraAttributes, c as WrappedInteractiveStateController, H as accessibilityAttributes, R as addGlobalStylesheet, L as assetContainerImgWidthValues, Q as assignCmsEditorSlot, $ as assignCmsEditorSlots, A as backgroundColorValues, j as backgroundSizeValues, G as booleanPropertyToAttributeSetter, O as borderColorValues, D as borderRadiusValues, k as borderSideValues, E as borderValues, M as boxShadowValues, V as checkName, x as colorValues, h as cssGridAlignSelfValues, _ as cssGridColSpanValues, g as cssGridJustifySelfValues, v as cssGridOrderValues, y as cssGridPlaceSelfValues, K as cssTokenBreakpoints, m as flexboxAlignSelfValues, b as fontsizeValues, S as fontweightValues, F as gapValues, n as getSupportedAttributeNames, t as getSupportedPropertyNames, B as getViewportFormat, P as gradientValues, p as gridGapValues, N as headingValues, C as iconSizeValues, ee as iconSizeValuesKC, o as isComponentDebug, z as isFalsy, s as log, I as noBorderRadiusValues, te as observeCmsEditorSlots, T as paddingValues, W as propertyToAttributeSetter, w as textalignValues, U as transferAccessibilityAttributes };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proximus/lavender-common",
3
- "version": "1.4.15-beta.1",
3
+ "version": "1.4.16-alpha.3",
4
4
  "description": "",
5
5
  "main": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,7 +11,8 @@
11
11
  "scripts": {
12
12
  "transform-package-json": "node ../../../scripts/tranformPackageJson.js package.json dist/far/away",
13
13
  "clean": "rm -rf dist",
14
- "build": "npm run clean && NODE_ENV=development vite build && tsc && npm run transform-package-json",
14
+ "build": "npm run clean && NODE_ENV=development vite build && npm run build:cms-editor-slots && tsc && npm run transform-package-json",
15
+ "build:cms-editor-slots": "NODE_ENV=development vite build --config vite.cms-editor-slots.config.js",
15
16
  "test": "vitest run --coverage"
16
17
  },
17
18
  "publishConfig": {