ablok-components 0.3.65 → 0.3.67

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.
@@ -29,6 +29,14 @@ declare const _default: import('../../../../vue/dist/vue.esm-bundler.js').Define
29
29
  };
30
30
  default: never[];
31
31
  };
32
+ stacked: {
33
+ type: BooleanConstructor;
34
+ default: boolean;
35
+ };
36
+ showCount: {
37
+ type: BooleanConstructor;
38
+ default: boolean;
39
+ };
32
40
  }>, {}, {}, {}, {}, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {
33
41
  select: (...args: any[]) => void;
34
42
  "update:modelValue": (...args: any[]) => void;
@@ -63,6 +71,14 @@ declare const _default: import('../../../../vue/dist/vue.esm-bundler.js').Define
63
71
  };
64
72
  default: never[];
65
73
  };
74
+ stacked: {
75
+ type: BooleanConstructor;
76
+ default: boolean;
77
+ };
78
+ showCount: {
79
+ type: BooleanConstructor;
80
+ default: boolean;
81
+ };
66
82
  }>> & Readonly<{
67
83
  onSelect?: ((...args: any[]) => any) | undefined;
68
84
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
@@ -71,5 +87,7 @@ declare const _default: import('../../../../vue/dist/vue.esm-bundler.js').Define
71
87
  messages: Record<string, any>;
72
88
  config: Record<string, any>;
73
89
  assets: any[];
90
+ stacked: boolean;
91
+ showCount: boolean;
74
92
  }, {}, {}, {}, string, import('../../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, true, {}, HTMLDivElement>;
75
93
  export default _default;
@@ -1,9 +1,18 @@
1
- import { defineComponent as o, ref as u, openBlock as d, createElementBlock as r, createVNode as s, withCtx as _, createElementVNode as m, normalizeClass as f } from "vue";
2
- import h from "../../templates/base-carousel/base-carousel.vue.js";
1
+ import { defineComponent as f, ref as _, openBlock as t, createElementBlock as i, createVNode as s, withCtx as b, createElementVNode as y, normalizeClass as o, Fragment as g, renderList as k, createBlock as C, toDisplayString as v, createCommentVNode as V } from "vue";
2
+ import $ from "../../templates/base-carousel/base-carousel.vue.js";
3
3
  /* empty css */
4
- import b from "../../atoms/base-image/base-image.vue.js";
4
+ import m from "../../atoms/base-image/base-image.vue.js";
5
5
  /* empty css */
6
- const v = { class: "media-thumbnails" }, C = ["onClick", "title"], V = { class: "img-container" }, B = /* @__PURE__ */ o({
6
+ const x = { class: "media-thumbnails" }, B = ["onClick", "title"], j = {
7
+ key: 0,
8
+ class: "img-container"
9
+ }, O = {
10
+ key: 0,
11
+ class: "media-thumbnails__count-badge"
12
+ }, w = {
13
+ key: 2,
14
+ class: "img-container"
15
+ }, I = /* @__PURE__ */ f({
7
16
  __name: "media-thumbnails",
8
17
  props: {
9
18
  modelValue: {
@@ -20,30 +29,53 @@ const v = { class: "media-thumbnails" }, C = ["onClick", "title"], V = { class:
20
29
  assets: {
21
30
  type: Array,
22
31
  default: []
32
+ },
33
+ stacked: {
34
+ type: Boolean,
35
+ default: !0
36
+ },
37
+ showCount: {
38
+ type: Boolean,
39
+ default: !0
23
40
  }
24
41
  },
25
42
  emits: ["update:modelValue", "select"],
26
- setup(i, { emit: n }) {
27
- const l = n, a = u(-1);
28
- function c(t) {
29
- a.value = t, l("update:modelValue", t), l("select", t);
43
+ setup(a, { emit: d }) {
44
+ const c = d, u = _(-1);
45
+ function r(l) {
46
+ u.value = l, c("update:modelValue", l), c("select", l);
30
47
  }
31
- return (t, $) => (d(), r("div", v, [
32
- s(h, { items: i.assets }, {
33
- "carousel-item": _((e) => [
34
- m("button", {
48
+ return (l, N) => (t(), i("div", x, [
49
+ s($, { items: a.assets }, {
50
+ "carousel-item": b((e) => [
51
+ y("button", {
35
52
  type: "button",
36
- class: f(["carousel__item media-thumbnails__thumbnail", e.index === i.modelValue || e.index === a.value ? "is-active" : ""]),
37
- onClick: (k) => c(e.index),
38
- title: `${t.$t("thumbnails.thumbnail")} ${e.index + 1}`
53
+ class: o(["carousel__item media-thumbnails__thumbnail", e.index === a.modelValue || e.index === u.value ? "is-active" : ""]),
54
+ onClick: (n) => r(e.index),
55
+ title: `${l.$t("thumbnails.thumbnail")} ${e.index + 1}`
39
56
  }, [
40
- m("div", V, [
41
- s(b, {
57
+ e.item.type === "preset" && e.item.thumbnail ? (t(), i("div", j, [
58
+ s(m, {
59
+ src: e.item.thumbnail,
60
+ class: "img-fluid"
61
+ }, null, 8, ["src"])
62
+ ])) : e.item.type === "preset" ? (t(), i("div", {
63
+ key: 1,
64
+ class: o(["img-container img-container--multi", { "img-container--stacked": a.stacked }])
65
+ }, [
66
+ (t(!0), i(g, null, k(e.item.items, (n, h) => (t(), C(m, {
67
+ key: h,
68
+ src: n.thumbnail || n.src,
69
+ class: "img-fluid"
70
+ }, null, 8, ["src"]))), 128)),
71
+ a.showCount && Object.keys(e.item.items || {}).length ? (t(), i("span", O, v(Object.keys(e.item.items || {}).length), 1)) : V("", !0)
72
+ ], 2)) : (t(), i("div", w, [
73
+ s(m, {
42
74
  src: e.item.thumbnail || e.item.src,
43
75
  class: "img-fluid"
44
76
  }, null, 8, ["src"])
45
- ])
46
- ], 10, C)
77
+ ]))
78
+ ], 10, B)
47
79
  ]),
48
80
  _: 1
49
81
  }, 8, ["items"])
@@ -51,5 +83,5 @@ const v = { class: "media-thumbnails" }, C = ["onClick", "title"], V = { class:
51
83
  }
52
84
  });
53
85
  export {
54
- B as default
86
+ I as default
55
87
  };
@@ -1,14 +1,14 @@
1
- import { defineComponent as L, ref as v, computed as m, useSlots as O, watch as f, openBlock as i, createBlock as N, TransitionGroup as C, withModifiers as V, normalizeClass as D, withCtx as M, createElementBlock as g, Fragment as _, renderList as x, createCommentVNode as p, createElementVNode as b, createVNode as A, renderSlot as k, createTextVNode as P, toDisplayString as j } from "vue";
2
- import { sanitizeHtml as z } from "../../../composables/useSanitize.js";
3
- import q from "../../atoms/svg-icon/svg-icon.vue.js";
1
+ import { defineComponent as H, ref as c, computed as L, useSlots as I, watch as f, openBlock as i, createBlock as M, TransitionGroup as N, withModifiers as A, normalizeClass as D, withCtx as x, createElementBlock as g, Fragment as O, renderList as C, createCommentVNode as p, createElementVNode as b, createVNode as P, renderSlot as E, createTextVNode as W, toDisplayString as j } from "vue";
2
+ import z from "dompurify";
3
+ import G from "../../atoms/svg-icon/svg-icon.vue.js";
4
4
  /* empty css */
5
- const F = ["onDragenter", "onDragover", "onDragleave", "onDragend", "onDrop", "innerHTML"], G = ["draggable", "onDragstart", "onDrag", "onDragenter", "onDragover", "onDragleave", "onDragend", "onDrop"], J = {
5
+ const R = ["onDragenter", "onDragover", "onDragleave", "onDragend", "onDrop", "innerHTML"], F = ["draggable", "onDragstart", "onDrag", "onDragenter", "onDragover", "onDragleave", "onDragend", "onDrop"], q = {
6
6
  key: 0,
7
7
  class: "sortable-list__drag-handle"
8
- }, K = ["onDragstart", "onDrag"], Q = {
8
+ }, J = ["onDragstart", "onDrag"], K = {
9
9
  key: 0,
10
10
  class: "sortable-list__item"
11
- }, ee = /* @__PURE__ */ L({
11
+ }, te = /* @__PURE__ */ H({
12
12
  __name: "sortable-list",
13
13
  props: {
14
14
  modelValue: {
@@ -42,113 +42,157 @@ const F = ["onDragenter", "onDragover", "onDragleave", "onDragend", "onDrop", "i
42
42
  "update:dragIndex",
43
43
  "update:dragOverIndex"
44
44
  ],
45
- setup(n, { emit: H }) {
46
- const S = n, o = v(!1), l = v(null), s = v(null), d = H, c = m({
45
+ setup(n, { emit: $ }) {
46
+ const V = n, l = c(!1), o = c(null), s = c(null), d = $, v = L({
47
47
  get() {
48
- return S.modelValue;
48
+ return V.modelValue;
49
49
  },
50
50
  set(e) {
51
51
  d("update:modelValue", e);
52
52
  }
53
- }), B = m(() => {
54
- const e = document.querySelector(".is-drag-item")?.outerHTML;
55
- return e ? z(e) : "";
56
- }), E = O(), I = m(() => E["list-append"]);
57
- function w(e, a) {
58
- e.dataTransfer && (e.dataTransfer.dropEffect = "move", e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("index", a.toLocaleString()), o.value = !0, l.value = a);
59
- }
60
- function y(e, a) {
61
- o.value = !1, l.value = null, s.value = null;
62
- }
63
- function R(e, a) {
53
+ }), m = c("");
54
+ function k(e) {
55
+ const a = e.currentTarget.closest(".sortable-list__item") ?? e.currentTarget;
56
+ m.value = z.sanitize(a.outerHTML, {
57
+ ALLOWED_TAGS: [
58
+ "b",
59
+ "i",
60
+ "em",
61
+ "strong",
62
+ "u",
63
+ "span",
64
+ "p",
65
+ "br",
66
+ "a",
67
+ "ul",
68
+ "ol",
69
+ "li",
70
+ "h1",
71
+ "h2",
72
+ "h3",
73
+ "h4",
74
+ "h5",
75
+ "h6",
76
+ "article",
77
+ "div",
78
+ "label",
79
+ "button",
80
+ "svg",
81
+ "use"
82
+ ],
83
+ ALLOWED_ATTR: [
84
+ "class",
85
+ "id",
86
+ "style",
87
+ "href",
88
+ "target",
89
+ "rel",
90
+ "title",
91
+ "type",
92
+ "aria-expanded",
93
+ "aria-controls",
94
+ "aria-labelledby",
95
+ "data-countdown"
96
+ ],
97
+ ALLOW_DATA_ATTR: !0
98
+ });
64
99
  }
100
+ const S = I(), B = L(() => S["list-append"]);
65
101
  function h(e, a) {
66
- s.value = l.value !== a ? a : null;
102
+ e.dataTransfer && (k(e), e.dataTransfer.dropEffect = "move", e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("index", a.toLocaleString()), l.value = !0, o.value = a);
67
103
  }
68
104
  function T(e, a) {
69
- s.value = l.value !== a ? a : null;
105
+ l.value = !1, o.value = null, s.value = null, m.value = "";
106
+ }
107
+ function Q(e, a) {
108
+ }
109
+ function y(e, a) {
110
+ s.value = o.value !== a ? a : null;
111
+ }
112
+ function w(e, a) {
113
+ s.value = o.value !== a ? a : null;
70
114
  }
71
115
  function U(e, a) {
72
116
  }
73
- function $(e, a) {
117
+ function _(e, a) {
74
118
  if (e.dataTransfer) {
75
119
  e.preventDefault();
76
- const u = Number(e.dataTransfer.getData("index")), r = a, t = [...c.value];
77
- (r || r === 0) && (u || u === 0) && t.splice(r, 0, t.splice(u, 1)[0]), c.value = t;
120
+ const u = Number(e.dataTransfer.getData("index")), r = a, t = [...v.value];
121
+ (r || r === 0) && (u || u === 0) && t.splice(r, 0, t.splice(u, 1)[0]), v.value = t;
78
122
  }
79
123
  }
80
- return f(() => o.value, (e) => {
124
+ return f(() => l.value, (e) => {
81
125
  d("update:isDragging", e);
82
- }, { immediate: !0 }), f(() => l.value, (e) => {
126
+ }, { immediate: !0 }), f(() => o.value, (e) => {
83
127
  d("update:dragIndex", e);
84
128
  }, { immediate: !0 }), f(() => s.value, (e) => {
85
129
  d("update:dragOverIndex", e);
86
- }, { immediate: !0 }), (e, a) => (i(), N(C, {
130
+ }, { immediate: !0 }), (e, a) => (i(), M(N, {
87
131
  name: "list",
88
132
  tag: "ul",
89
133
  class: D(["sortable-list p-0 d-flex gap-2", {
90
134
  "flex-column": n.vertical,
91
135
  "flex-row flex-wrap": !n.vertical
92
136
  }]),
93
- onDragover: a[0] || (a[0] = V(() => {
137
+ onDragover: a[0] || (a[0] = A(() => {
94
138
  }, ["prevent"])),
95
- onDragenter: a[1] || (a[1] = V(() => {
139
+ onDragenter: a[1] || (a[1] = A(() => {
96
140
  }, ["prevent"]))
97
141
  }, {
98
- default: M(() => [
99
- (i(!0), g(_, null, x(c.value, (u, r) => (i(), g(_, { key: r }, [
100
- n.showPreview && o.value && s.value === r ? (i(), g("li", {
142
+ default: x(() => [
143
+ (i(!0), g(O, null, C(v.value, (u, r) => (i(), g(O, { key: r }, [
144
+ n.showPreview && l.value && s.value === r ? (i(), g("li", {
101
145
  key: 0,
102
146
  class: "sortable-list__item is-drop-target",
103
- onDragenter: (t) => h(t, r),
104
- onDragover: (t) => T(t, r),
147
+ onDragenter: (t) => y(t, r),
148
+ onDragover: (t) => w(t, r),
105
149
  onDragleave: (t) => void 0,
106
- onDragend: (t) => y(),
107
- onDrop: (t) => $(t, r),
108
- innerHTML: B.value
109
- }, null, 40, F)) : p("", !0),
150
+ onDragend: (t) => T(),
151
+ onDrop: (t) => _(t, r),
152
+ innerHTML: m.value
153
+ }, null, 40, R)) : p("", !0),
110
154
  b("li", {
111
155
  class: D(["sortable-list__item d-flex", {
112
- "is-drag-item": o.value && l.value === r,
113
- "is-drop-target": o.value && s.value === r && !n.showPreview,
156
+ "is-drag-item": l.value && o.value === r,
157
+ "is-drop-target": l.value && s.value === r && !n.showPreview,
114
158
  "align-items-center gap-2": n.vertical
115
159
  }]),
116
160
  draggable: !n.showDragHandle,
117
- onDragstart: (t) => w(t, r),
161
+ onDragstart: (t) => h(t, r),
118
162
  onDrag: (t) => void 0,
119
- onDragenter: (t) => h(t, r),
120
- onDragover: (t) => T(t, r),
163
+ onDragenter: (t) => y(t, r),
164
+ onDragover: (t) => w(t, r),
121
165
  onDragleave: (t) => void 0,
122
- onDragend: (t) => y(),
123
- onDrop: (t) => $(t, r)
166
+ onDragend: (t) => T(),
167
+ onDrop: (t) => _(t, r)
124
168
  }, [
125
- n.showDragHandle ? (i(), g("div", J, [
169
+ n.showDragHandle ? (i(), g("div", q, [
126
170
  b("button", {
127
171
  type: "button",
128
172
  class: "btn",
129
173
  draggable: "true",
130
- onDragstart: (t) => w(t, r),
174
+ onDragstart: (t) => h(t, r),
131
175
  onDrag: (t) => void 0
132
176
  }, [
133
- A(q, { symbol: "drag" })
134
- ], 40, K)
177
+ P(G, { symbol: "drag" })
178
+ ], 40, J)
135
179
  ])) : p("", !0),
136
180
  b("div", {
137
181
  class: D(["sortable-list__item-content", {
138
182
  "flex-grow-1": n.vertical
139
183
  }])
140
184
  }, [
141
- k(e.$slots, "list-item", {
185
+ E(e.$slots, "list-item", {
142
186
  item: u,
143
187
  index: r
144
188
  }, () => [
145
- P(j(u), 1)
189
+ W(j(u), 1)
146
190
  ])
147
191
  ], 2)
148
- ], 42, G)
192
+ ], 42, F)
149
193
  ], 64))), 128)),
150
- I.value ? (i(), g("li", Q, [
151
- k(e.$slots, "list-append")
194
+ B.value ? (i(), g("li", K, [
195
+ E(e.$slots, "list-append")
152
196
  ])) : p("", !0)
153
197
  ]),
154
198
  _: 3
@@ -156,5 +200,5 @@ const F = ["onDragenter", "onDragover", "onDragleave", "onDragend", "onDrop", "i
156
200
  }
157
201
  });
158
202
  export {
159
- ee as default
203
+ te as default
160
204
  };
@@ -11,3 +11,21 @@ export interface IMediaObject {
11
11
  * Single media value (non-array)
12
12
  */
13
13
  export type MediaValue = IMediaObject | string | undefined;
14
+ /**
15
+ * A single layer inside a preset asset (background, overlay, object, …)
16
+ */
17
+ export interface IPresetAssetItem {
18
+ src: string;
19
+ thumbnail?: string;
20
+ type: string;
21
+ mediaType: string;
22
+ }
23
+ /**
24
+ * Preset asset — a named collection of layered items with an optional composite thumbnail
25
+ */
26
+ export interface IPresetAsset {
27
+ type: 'preset';
28
+ thumbnail?: string;
29
+ filters?: string[];
30
+ items: Record<string, IPresetAssetItem>;
31
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ablok-components",
3
3
  "private": false,
4
- "version": "0.3.65",
4
+ "version": "0.3.67",
5
5
  "dependencies": {
6
6
  "date-fns": "^3.0.0",
7
7
  "dompurify": "^3.3.1",
@@ -10,8 +10,6 @@
10
10
  "ofetch": "^1.5.1"
11
11
  },
12
12
  "peerDependencies": {
13
- "vue": "^3.5.27",
14
- "vue-i18n": "^11.2.8",
15
13
  "@tiptap/core": "^3.18.0",
16
14
  "@tiptap/extension-bold": "^3.18.0",
17
15
  "@tiptap/extension-highlight": "^3.18.0",
@@ -21,11 +19,13 @@
21
19
  "@tiptap/starter-kit": "^3.18.0",
22
20
  "@tiptap/vue-3": "^3.18.0",
23
21
  "@vue-leaflet/vue-leaflet": "^0.10.1",
24
- "leaflet": "^1.9.4",
25
22
  "@vuepic/vue-datepicker": "^12.1.0",
26
23
  "canvas-confetti": "^1.9.4",
24
+ "leaflet": "^1.9.4",
25
+ "qr-code-styling": "^1.9.2",
26
+ "vue": "^3.5.27",
27
27
  "vue-advanced-cropper": "^2.8.9",
28
- "qr-code-styling": "^1.9.2"
28
+ "vue-i18n": "^11.2.8"
29
29
  },
30
30
  "peerDependenciesMeta": {
31
31
  "@tiptap/core": {
@@ -73,7 +73,9 @@
73
73
  },
74
74
  "devDependencies": {
75
75
  "@histoire/plugin-vue": "^1.0.0-beta.1",
76
+ "@popperjs/core": "^2.11.8",
76
77
  "@types/canvas-confetti": "^1.9.0",
78
+ "@types/dompurify": "^3.0.5",
77
79
  "@types/leaflet": "^1.9.21",
78
80
  "@types/lodash": "^4.17.23",
79
81
  "@types/node": "^25.1.0",
@@ -82,9 +84,7 @@
82
84
  "@vitest/ui": "^4.1.5",
83
85
  "@vue/compiler-dom": "^3.5.33",
84
86
  "@vue/test-utils": "^2.4.10",
85
- "@types/dompurify": "^3.0.5",
86
87
  "bootstrap": "^5.3.8",
87
- "@popperjs/core": "^2.11.8",
88
88
  "flexsearch": "^0.8.212",
89
89
  "glob": "^13.0.0",
90
90
  "happy-dom": "^20.9.0",