@cntrl-site/components 1.0.111-alpha.0 → 1.0.111-alpha.2

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.
Files changed (61) hide show
  1. package/dist/{Burger-C3yVbQcq.js → Burger-B4kXX9aY.js} +1 -1
  2. package/dist/{Burger-BkVgNMGU.mjs → Burger-DyORh_vF.mjs} +1 -1
  3. package/dist/{ChroniclesComponent-FFenN7yL.js → ChroniclesComponent-B6L-8Gn2.js} +1 -1
  4. package/dist/{ChroniclesComponent-cZLqN307.mjs → ChroniclesComponent-adaAqTy8.mjs} +12 -12
  5. package/dist/Components/PopupMenu/PopupMenu.d.ts +18 -5
  6. package/dist/Components/PopupMenu/PopupMenuComponent.d.ts +125 -134
  7. package/dist/Components/PopupMenu/popupMenuLayout.d.ts +70 -34
  8. package/dist/Components/helpers/SvgImage/loadSvgMaskUrl.d.ts +7 -0
  9. package/dist/{ControlSlider-DqKfaKMG.mjs → ControlSlider-3w-bHQEg.mjs} +1 -1
  10. package/dist/{ControlSlider-C8ckUIDm.js → ControlSlider-DB4nbVLT.js} +1 -1
  11. package/dist/{FAQ-BS-vO0l-.mjs → FAQ-BjLLn81l.mjs} +1 -1
  12. package/dist/{FAQ-Ct0YfqX1.js → FAQ-C5evIqbl.js} +1 -1
  13. package/dist/{Grid-CU1dsdoO.js → Grid-BXUT_Hn6.js} +1 -1
  14. package/dist/{Grid-qbqchSLi.mjs → Grid-Dn44dvgx.mjs} +1 -1
  15. package/dist/{Hive-CzabuuCc.js → Hive-34KvKNsa.js} +1 -1
  16. package/dist/{Hive-DyxYd5eg.mjs → Hive-7xHXyMM1.mjs} +1 -1
  17. package/dist/{HiveLightboxTitles-DhEeFKWs.mjs → HiveLightboxTitles-BCoL46-V.mjs} +1 -1
  18. package/dist/{HiveLightboxTitles-DlyptAaK.js → HiveLightboxTitles-DEeyQGcf.js} +1 -1
  19. package/dist/{Lightbox-DZckgBzK.js → Lightbox-Cb7lyaNt.js} +1 -1
  20. package/dist/{Lightbox-BY99NS14.mjs → Lightbox-DzPqgKP4.mjs} +1 -1
  21. package/dist/{LightboxJournal-DAEZOPDi.js → LightboxJournal-BFF5aKRz.js} +1 -1
  22. package/dist/{LightboxJournal-D59ex6wH.mjs → LightboxJournal-C_q7_s-B.mjs} +1 -1
  23. package/dist/{LightboxStrip-YspzBP8N.mjs → LightboxStrip-BrNj7ipX.mjs} +1 -1
  24. package/dist/{LightboxStrip-BDjI1jyH.js → LightboxStrip-CC2e0_9A.js} +1 -1
  25. package/dist/{Mercury-B-s2Kvuq.js → Mercury-BmhtFYOw.js} +1 -1
  26. package/dist/{Mercury-CCW0Es-s.mjs → Mercury-Q788wrYQ.mjs} +1 -1
  27. package/dist/{OnelinerForm-C2Y_XMCY.js → OnelinerForm-CUmY-bXL.js} +1 -1
  28. package/dist/{OnelinerForm-BEu7_sho.mjs → OnelinerForm-D8WIB9Qy.mjs} +1 -1
  29. package/dist/PopupMenu-BYZy1R1y.js +356 -0
  30. package/dist/PopupMenu-DXWVDnPf.mjs +972 -0
  31. package/dist/{SimpleButton-C-o2W9bS.mjs → SimpleButton-DTpzfmb6.mjs} +1 -1
  32. package/dist/{SimpleButton-nGEcO2gB.js → SimpleButton-DtaCYa3y.js} +1 -1
  33. package/dist/{Slider20-DUi6qwnd.mjs → Slider20-CKngROrc.mjs} +1 -1
  34. package/dist/{Slider20-BOmjDRf2.js → Slider20-q0iGgnE3.js} +1 -1
  35. package/dist/SvgImage-CwRq9-ec.mjs +56 -0
  36. package/dist/SvgImage-_QN8ngad.js +1 -0
  37. package/dist/{TestimonialSingle-DrnyReim.mjs → TestimonialSingle-Bax71Hyo.mjs} +1 -1
  38. package/dist/{TestimonialSingle-BORQom3u.js → TestimonialSingle-CpEUendN.js} +1 -1
  39. package/dist/{Waterfall-DII4-WV5.js → Waterfall-B9YWMhrg.js} +1 -1
  40. package/dist/{Waterfall-3kKioKh2.mjs → Waterfall-znaoynn5.mjs} +1 -1
  41. package/dist/{components-ByRCe3b5.js → components-Ce8GmbzS.js} +1 -1
  42. package/dist/{components-DbxkGNoB.mjs → components-QxlSJUUn.mjs} +176 -144
  43. package/dist/elements.js +1 -1
  44. package/dist/elements.mjs +15 -15
  45. package/dist/elements.node.js +1 -1
  46. package/dist/elements.node.mjs +1 -1
  47. package/dist/index.d.ts +2 -2
  48. package/dist/index.js +1 -1
  49. package/dist/index.mjs +39 -34
  50. package/dist/loadSvgMaskUrl-B6kHUyof.js +1 -0
  51. package/dist/loadSvgMaskUrl-DUhCVvpl.mjs +39 -0
  52. package/dist/sources.js +1 -1
  53. package/dist/sources.mjs +1 -1
  54. package/dist/types/SchemaV1.d.ts +2 -1
  55. package/package.json +1 -1
  56. package/dist/PopupMenu-BVc8Y4Tt.mjs +0 -929
  57. package/dist/PopupMenu-Dty5qHl8.js +0 -348
  58. package/dist/SvgImage-B5mR9y6q.mjs +0 -51
  59. package/dist/SvgImage-DFlmxAoL.js +0 -1
  60. package/dist/loadSvgMaskUrl-DfF7ay6h.js +0 -1
  61. package/dist/loadSvgMaskUrl-xHgGYgPe.mjs +0 -20
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./components-ByRCe3b5.js"),l=require("./panelAvailability-DnOe0rQ4.js"),e=require("./PopupMenu-Dty5qHl8.js");function d(t){return t.type==="object"&&t.version===1}function p(t){return{assetId:t,name:"",type:"image",objectFit:"cover"}}function M(t,{text:o,images:n}){switch(t){case"media-pair-list-input":return n.map(i=>({media:[p(i),p("")]}));case"media-list-input":return n.map(p);case"media-input":return n.length>0?p(n[0]):{assetId:"",name:""};case"rich-text":return[{type:"paragraph",children:[{text:o}]}];case"link-input":return{type:"url",value:"",target:"self"};default:return o}}function c(t,{pageId:o,slug:n}){return t==="link-input"?{type:"page",value:o,target:"self"}:`/${n}`}function g(t){var n;const o=((n=t==null?void 0:t.items)==null?void 0:n.properties)??{};return Object.entries(o).map(([i,a])=>{var P;const s=(P=a.display)==null?void 0:P.type;return{fieldKey:i,...a.contentKey!==void 0?{contentKey:a.contentKey}:{},fromEntry:r=>M(s,r),toPage:r=>c(s,r)}})}const m=[u.ControlSliderComponent.id,u.ControlImageRevealSliderComponent.id,u.LightboxComponent.id,u.PopupMenuComponent.id];exports.components=u.components;exports.getAvailableStatePanels=l.getAvailableStatePanels;exports.getUnavailableStates=l.getUnavailableStates;exports.isPanelAvailable=l.isPanelAvailable;exports.DEFAULT_POPUP_MENU_GRID=e.DEFAULT_POPUP_MENU_GRID;exports.DEFAULT_POPUP_MENU_HEIGHT=e.DEFAULT_POPUP_MENU_HEIGHT;exports.defaultPopupMenuLayoutRules=e.defaultPopupMenuLayoutRules;exports.fitPopupMenuLayoutToGrid=e.fitPopupMenuLayoutToGrid;exports.generatePopupMenuLayout=e.generatePopupMenuLayout;exports.getPopupMenuGrid=e.getPopupMenuGrid;exports.getPopupMenuHeight=e.getPopupMenuHeight;exports.getPopupMenuSides=e.getPopupMenuSides;exports.isSamePopupMenuGrid=e.isSamePopupMenuGrid;exports.movePopupMenuBlock=e.movePopupMenuBlock;exports.randomPopupMenuSeed=e.randomPopupMenuSeed;exports.resizePopupMenuBlock=e.resizePopupMenuBlock;exports.settlePopupMenuLayout=e.settlePopupMenuLayout;exports.snapPopupMenuHeight=e.snapPopupMenuHeight;exports.snapPopupMenuTop=e.snapPopupMenuTop;exports.getPostFieldBindings=g;exports.isSchemaV1=d;exports.nonForkableComponentIds=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./components-Ce8GmbzS.js"),r=require("./panelAvailability-DnOe0rQ4.js"),e=require("./PopupMenu-BYZy1R1y.js");function M(t){return t.type==="object"&&t.version===1}function p(t){return{assetId:t,name:"",type:"image",objectFit:"cover"}}function d(t,{text:u,images:n}){switch(t){case"media-pair-list-input":return n.map(i=>({media:[p(i),p("")]}));case"media-list-input":return n.map(p);case"media-input":return n.length>0?p(n[0]):{assetId:"",name:""};case"rich-text":return[{type:"paragraph",children:[{text:u}]}];case"link-input":return{type:"url",value:"",target:"self"};default:return u}}function g(t,{pageId:u,slug:n}){return t==="link-input"?{type:"page",value:u,target:"self"}:`/${n}`}function c(t){var n;const u=((n=t==null?void 0:t.items)==null?void 0:n.properties)??{};return Object.entries(u).map(([i,a])=>{var s;const l=(s=a.display)==null?void 0:s.type;return{fieldKey:i,...a.contentKey!==void 0?{contentKey:a.contentKey}:{},fromEntry:P=>d(l,P),toPage:P=>g(l,P)}})}const m=[o.ControlSliderComponent.id,o.ControlImageRevealSliderComponent.id,o.LightboxComponent.id,o.PopupMenuComponent.id];exports.components=o.components;exports.getAvailableStatePanels=r.getAvailableStatePanels;exports.getUnavailableStates=r.getUnavailableStates;exports.isPanelAvailable=r.isPanelAvailable;exports.DEFAULT_POPUP_MENU_GRID=e.DEFAULT_POPUP_MENU_GRID;exports.DEFAULT_POPUP_MENU_HEIGHT=e.DEFAULT_POPUP_MENU_HEIGHT;exports.DEFAULT_POPUP_MENU_VIEWPORT_RATIO=e.DEFAULT_POPUP_MENU_VIEWPORT_RATIO;exports.POPUP_MENU_ALIGNS=e.POPUP_MENU_ALIGNS;exports.defaultPopupMenuLayoutRules=e.defaultPopupMenuLayoutRules;exports.fitPopupMenuLayoutToGrid=e.fitPopupMenuLayoutToGrid;exports.generatePopupMenuLayout=e.generatePopupMenuLayout;exports.getPopupMenuAlign=e.getPopupMenuAlign;exports.getPopupMenuGrid=e.getPopupMenuGrid;exports.getPopupMenuHeight=e.getPopupMenuHeight;exports.getPopupMenuHeightPercent=e.getPopupMenuHeightPercent;exports.getPopupMenuSides=e.getPopupMenuSides;exports.getPopupMenuWidth=e.getPopupMenuWidth;exports.isSamePopupMenuGrid=e.isSamePopupMenuGrid;exports.movePopupMenuBlock=e.movePopupMenuBlock;exports.randomPopupMenuSeed=e.randomPopupMenuSeed;exports.resizePopupMenuBlock=e.resizePopupMenuBlock;exports.settlePopupMenuLayout=e.settlePopupMenuLayout;exports.snapPopupMenuHeight=e.snapPopupMenuHeight;exports.snapPopupMenuTop=e.snapPopupMenuTop;exports.getPostFieldBindings=c;exports.isSchemaV1=M;exports.nonForkableComponentIds=m;
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { C as s, a as l, L as d, P } from "./components-DbxkGNoB.mjs";
2
- import { c as C } from "./components-DbxkGNoB.mjs";
3
- import { g as S, a as E, i as U } from "./panelAvailability-D179wwJx.mjs";
4
- import { D as _, k as h, j as x, f as F, g as G, e as I, c as T, d as j, i as A, m as D, h as H, r as B, s as K, b as O, a as R } from "./PopupMenu-BVc8Y4Tt.mjs";
5
- function f(e) {
1
+ import { C as s, a as P, L as l, P as d } from "./components-QxlSJUUn.mjs";
2
+ import { c as E } from "./components-QxlSJUUn.mjs";
3
+ import { g as L, a as b, i as S } from "./panelAvailability-D179wwJx.mjs";
4
+ import { l as C, p as I, D as T, P as h, o as O, f as k, g as F, e as G, k as x, c as D, d as H, j as N, h as R, i as j, m as B, n as K, r as V, s as W, b as w, a as z } from "./PopupMenu-DXWVDnPf.mjs";
5
+ function M(e) {
6
6
  return e.type === "object" && e.version === 1;
7
7
  }
8
8
  function a(e) {
@@ -24,50 +24,55 @@ function c(e, { text: n, images: t }) {
24
24
  return n;
25
25
  }
26
26
  }
27
- function m(e, { pageId: n, slug: t }) {
27
+ function g(e, { pageId: n, slug: t }) {
28
28
  return e === "link-input" ? { type: "page", value: n, target: "self" } : `/${t}`;
29
29
  }
30
- function M(e) {
30
+ function f(e) {
31
31
  var t;
32
32
  const n = ((t = e == null ? void 0 : e.items) == null ? void 0 : t.properties) ?? {};
33
33
  return Object.entries(n).map(([o, p]) => {
34
- var i;
35
- const r = (i = p.display) == null ? void 0 : i.type;
34
+ var r;
35
+ const i = (r = p.display) == null ? void 0 : r.type;
36
36
  return {
37
37
  fieldKey: o,
38
38
  ...p.contentKey !== void 0 ? { contentKey: p.contentKey } : {},
39
- fromEntry: (u) => c(r, u),
40
- toPage: (u) => m(r, u)
39
+ fromEntry: (u) => c(i, u),
40
+ toPage: (u) => g(i, u)
41
41
  };
42
42
  });
43
43
  }
44
44
  const y = [
45
45
  s.id,
46
+ P.id,
46
47
  l.id,
47
- d.id,
48
- P.id
48
+ d.id
49
49
  ];
50
50
  export {
51
- _ as DEFAULT_POPUP_MENU_GRID,
52
- h as DEFAULT_POPUP_MENU_HEIGHT,
53
- C as components,
54
- x as defaultPopupMenuLayoutRules,
55
- F as fitPopupMenuLayoutToGrid,
56
- G as generatePopupMenuLayout,
57
- S as getAvailableStatePanels,
58
- I as getPopupMenuGrid,
59
- T as getPopupMenuHeight,
60
- j as getPopupMenuSides,
61
- M as getPostFieldBindings,
62
- E as getUnavailableStates,
63
- U as isPanelAvailable,
64
- A as isSamePopupMenuGrid,
65
- f as isSchemaV1,
66
- D as movePopupMenuBlock,
51
+ C as DEFAULT_POPUP_MENU_GRID,
52
+ I as DEFAULT_POPUP_MENU_HEIGHT,
53
+ T as DEFAULT_POPUP_MENU_VIEWPORT_RATIO,
54
+ h as POPUP_MENU_ALIGNS,
55
+ E as components,
56
+ O as defaultPopupMenuLayoutRules,
57
+ k as fitPopupMenuLayoutToGrid,
58
+ F as generatePopupMenuLayout,
59
+ L as getAvailableStatePanels,
60
+ G as getPopupMenuAlign,
61
+ x as getPopupMenuGrid,
62
+ D as getPopupMenuHeight,
63
+ H as getPopupMenuHeightPercent,
64
+ N as getPopupMenuSides,
65
+ R as getPopupMenuWidth,
66
+ f as getPostFieldBindings,
67
+ b as getUnavailableStates,
68
+ S as isPanelAvailable,
69
+ j as isSamePopupMenuGrid,
70
+ M as isSchemaV1,
71
+ B as movePopupMenuBlock,
67
72
  y as nonForkableComponentIds,
68
- H as randomPopupMenuSeed,
69
- B as resizePopupMenuBlock,
70
- K as settlePopupMenuLayout,
71
- O as snapPopupMenuHeight,
72
- R as snapPopupMenuTop
73
+ K as randomPopupMenuSeed,
74
+ V as resizePopupMenuBlock,
75
+ W as settlePopupMenuLayout,
76
+ w as snapPopupMenuHeight,
77
+ z as snapPopupMenuTop
73
78
  };
@@ -0,0 +1 @@
1
+ "use strict";const a=new Map,i=new Map;function r(t){return t.startsWith("data:")||t.startsWith("blob:")}function c(t){return/^data:image\/svg\+xml[;,]/i.test(t.trim())}async function o(t){const e=t.type.toLowerCase();if(e.startsWith("image/svg+xml"))return!0;if(e.startsWith("image/")||e.startsWith("video/"))return!1;const s=(await t.slice(0,1024).text()).trimStart().toLowerCase();return s.startsWith("<svg")||s.startsWith("<?xml")&&s.includes("<svg")}function h(t){if(t.startsWith("data:"))return Promise.resolve(c(t));const e=i.get(t);if(e)return e;const s=fetch(t).then(n=>n.blob()).then(o).catch(()=>!1);return i.set(t,s),s}function g(t){if(r(t))return Promise.resolve(t);const e=a.get(t);if(e)return e;const s=fetch(t,{mode:"cors",cache:"reload"}).then(n=>{if(!n.ok)throw new Error(String(n.status));return n.blob()}).then(n=>URL.createObjectURL(n)).catch(n=>{throw a.delete(t),n});return a.set(t,s),s}exports.isInlineMaskUrl=r;exports.isInlineSvgUrl=h;exports.isSvgDataUrl=c;exports.loadSvgMaskUrl=g;
@@ -0,0 +1,39 @@
1
+ const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
2
+ function i(t) {
3
+ return t.startsWith("data:") || t.startsWith("blob:");
4
+ }
5
+ function c(t) {
6
+ return /^data:image\/svg\+xml[;,]/i.test(t.trim());
7
+ }
8
+ async function o(t) {
9
+ const e = t.type.toLowerCase();
10
+ if (e.startsWith("image/svg+xml")) return !0;
11
+ if (e.startsWith("image/") || e.startsWith("video/")) return !1;
12
+ const s = (await t.slice(0, 1024).text()).trimStart().toLowerCase();
13
+ return s.startsWith("<svg") || s.startsWith("<?xml") && s.includes("<svg");
14
+ }
15
+ function h(t) {
16
+ if (t.startsWith("data:")) return Promise.resolve(c(t));
17
+ const e = r.get(t);
18
+ if (e) return e;
19
+ const s = fetch(t).then((a) => a.blob()).then(o).catch(() => !1);
20
+ return r.set(t, s), s;
21
+ }
22
+ function g(t) {
23
+ if (i(t)) return Promise.resolve(t);
24
+ const e = n.get(t);
25
+ if (e) return e;
26
+ const s = fetch(t, { mode: "cors", cache: "reload" }).then((a) => {
27
+ if (!a.ok) throw new Error(String(a.status));
28
+ return a.blob();
29
+ }).then((a) => URL.createObjectURL(a)).catch((a) => {
30
+ throw n.delete(t), a;
31
+ });
32
+ return n.set(t, s), s;
33
+ }
34
+ export {
35
+ c as a,
36
+ h as b,
37
+ i,
38
+ g as l
39
+ };
package/dist/sources.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./ChroniclesComponent-FFenN7yL.js"),e=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./ChroniclesComponent-B6L-8Gn2.js"),e=`import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
2
2
  import { CommonComponentProps } from '../props';
3
3
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
4
4
  import { useLightboxScrollLock } from '../utils/useLightboxScrollLock';
package/dist/sources.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { W as n, b as e, T as t, g as i, f as o, S as r, P as a, O as s, h as l, a as c, M as d, L as u, d as g, e as m, H as p, i as h, G as f, F as v, c as P, C as x, j as b, B as y } from "./ChroniclesComponent-cZLqN307.mjs";
1
+ import { W as n, b as e, T as t, g as i, f as o, S as r, P as a, O as s, h as l, a as c, M as d, L as u, d as g, e as m, H as p, i as h, G as f, F as v, c as P, C as x, j as b, B as y } from "./ChroniclesComponent-adaAqTy8.mjs";
2
2
  const S = `import { Fragment, useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type MouseEvent, type PointerEvent, type ReactNode } from 'react';
3
3
  import { CommonComponentProps } from '../props';
4
4
  import { buildColorVars, scalingValue, useScopedStyles } from '../utils';
@@ -97,7 +97,8 @@ export type ComponentContentProperty = {
97
97
  min?: number;
98
98
  max?: number;
99
99
  default?: unknown;
100
- /** How the field is drawn instead in a row whose `type` is one of these keys, laid over the rest. */
100
+ /** How the field is drawn instead in a row whose `type` is one of these keys, laid over the rest; a display
101
+ * with `visible: false` leaves the field out of those rows. */
101
102
  byRowType?: Record<string, Pick<ComponentContentProperty, 'placeholder' | 'display'>>;
102
103
  };
103
104
  export type ComponentContentSchema = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/components",
3
- "version": "1.0.111-alpha.0",
3
+ "version": "1.0.111-alpha.2",
4
4
  "description": "Custom components for control editor and public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",