@tailor-cms/ce-image-display 1.1.0 → 2.0.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/components/Display.vue.d.ts +3 -3
- package/dist/index.cjs +93 -80
- package/dist/index.css +21 -1
- package/dist/index.js +89 -81
- package/package.json +13 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Element } from '@tailor-cms/ce-image-manifest';
|
|
1
|
+
import type { Element } from '@tailor-cms/ce-image-manifest';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
element: Element;
|
|
4
|
-
userState: any;
|
|
5
4
|
};
|
|
6
|
-
declare const
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
7
|
export default _default;
|
package/dist/index.cjs
CHANGED
|
@@ -1,92 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
require('./index.css');let vue = require("vue");
|
|
6
|
+
//#region ../manifest/dist/index.mjs
|
|
5
7
|
var type = "IMAGE";
|
|
6
8
|
var name = "Image";
|
|
7
9
|
var initState = () => ({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
url: null,
|
|
11
|
+
alt: "",
|
|
12
|
+
assets: {}
|
|
11
13
|
});
|
|
12
|
-
var version = "1.0";
|
|
13
14
|
var ui = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// Does element support only full width or can be used within layouts
|
|
17
|
-
// (e.g. 50/50 layout)
|
|
18
|
-
forceFullWidth: false
|
|
15
|
+
icon: "mdi-image",
|
|
16
|
+
forceFullWidth: false
|
|
19
17
|
};
|
|
18
|
+
var isEmpty = (data) => !data.url;
|
|
20
19
|
var manifest$1 = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
type,
|
|
21
|
+
version: "1.0",
|
|
22
|
+
name,
|
|
23
|
+
ssr: false,
|
|
24
|
+
initState,
|
|
25
|
+
isEmpty,
|
|
26
|
+
ui
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/components/Display.vue?vue&type=script&setup=true&lang.ts
|
|
30
|
+
var _hoisted_1 = { class: "tce-image-root" };
|
|
31
|
+
var _hoisted_2 = ["aria-label"];
|
|
32
|
+
var _hoisted_3 = { class: "d-flex align-center justify-center fill-height" };
|
|
33
|
+
var _hoisted_4 = ["alt", "src"];
|
|
34
|
+
var Display_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
35
|
+
__name: "Display",
|
|
36
|
+
props: { element: {} },
|
|
37
|
+
setup(__props) {
|
|
38
|
+
const props = __props;
|
|
39
|
+
const closeBtn = (0, vue.useTemplateRef)("closeBtn");
|
|
40
|
+
const url = (0, vue.computed)(() => props.element.data.url);
|
|
41
|
+
return (_ctx, _cache) => {
|
|
42
|
+
const _component_VProgressCircular = (0, vue.resolveComponent)("VProgressCircular");
|
|
43
|
+
const _component_VImg = (0, vue.resolveComponent)("VImg");
|
|
44
|
+
const _component_VBtn = (0, vue.resolveComponent)("VBtn");
|
|
45
|
+
const _component_VDialog = (0, vue.resolveComponent)("VDialog");
|
|
46
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, [(0, vue.createVNode)(_component_VDialog, {
|
|
47
|
+
"aria-label": "Image viewer",
|
|
48
|
+
"content-class": "d-flex align-center justify-center h-100 w-100",
|
|
49
|
+
transition: "fade-transition",
|
|
50
|
+
onAfterEnter: _cache[0] || (_cache[0] = ($event) => closeBtn.value?.$el?.focus())
|
|
51
|
+
}, {
|
|
52
|
+
activator: (0, vue.withCtx)(({ props: overlayProps }) => [(0, vue.createElementVNode)("button", (0, vue.mergeProps)(overlayProps, {
|
|
53
|
+
"aria-label": `Open image viewer: ${__props.element.data.alt || "image"}`,
|
|
54
|
+
class: "image-viewer-activator"
|
|
55
|
+
}), [(0, vue.createVNode)(_component_VImg, {
|
|
56
|
+
alt: __props.element.data.alt,
|
|
57
|
+
src: url.value,
|
|
58
|
+
class: "mx-auto",
|
|
59
|
+
rounded: "lg"
|
|
60
|
+
}, {
|
|
61
|
+
placeholder: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_3, [(0, vue.createVNode)(_component_VProgressCircular, {
|
|
62
|
+
"aria-label": "Loading image",
|
|
63
|
+
color: "blue-grey-darken-3",
|
|
64
|
+
indeterminate: ""
|
|
65
|
+
})])]),
|
|
66
|
+
_: 1
|
|
67
|
+
}, 8, ["alt", "src"])], 16, _hoisted_2)]),
|
|
68
|
+
default: (0, vue.withCtx)(({ isActive }) => [(0, vue.createVNode)(_component_VBtn, {
|
|
69
|
+
ref_key: "closeBtn",
|
|
70
|
+
ref: closeBtn,
|
|
71
|
+
"aria-label": "Close image viewer",
|
|
72
|
+
class: "position-absolute top-0 right-0",
|
|
73
|
+
color: "white",
|
|
74
|
+
icon: "mdi-close",
|
|
75
|
+
variant: "tonal",
|
|
76
|
+
onClick: ($event) => isActive.value = false
|
|
77
|
+
}, null, 8, ["onClick"]), (0, vue.createElementVNode)("img", {
|
|
78
|
+
alt: __props.element.data.alt,
|
|
79
|
+
src: url.value,
|
|
80
|
+
class: "viewer-image"
|
|
81
|
+
}, null, 8, _hoisted_4)]),
|
|
82
|
+
_: 1
|
|
83
|
+
})]);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
78
86
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region \0plugin-vue:export-helper
|
|
89
|
+
var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
90
|
+
const target = sfc.__vccOpts || sfc;
|
|
91
|
+
for (const [key, val] of props) target[key] = val;
|
|
92
|
+
return target;
|
|
85
93
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/components/Display.vue
|
|
96
|
+
var Display_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Display_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-befe605b"]]);
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/index.ts
|
|
99
|
+
var manifest = {
|
|
100
|
+
...manifest$1,
|
|
101
|
+
Display: Display_default
|
|
90
102
|
};
|
|
91
|
-
|
|
103
|
+
//#endregion
|
|
104
|
+
exports.Display = Display_default;
|
|
92
105
|
exports.default = manifest;
|
package/dist/index.css
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
.
|
|
2
|
+
.image-viewer-activator {
|
|
3
|
+
&[data-v-befe605b] {
|
|
4
|
+
display: block;
|
|
5
|
+
width: 100%;
|
|
6
|
+
border: none;
|
|
7
|
+
padding: 0;
|
|
8
|
+
background: transparent;
|
|
9
|
+
border-radius: 8px;
|
|
10
|
+
}
|
|
11
|
+
&[data-v-befe605b]:focus-visible {
|
|
12
|
+
outline: 3px solid highlight;
|
|
13
|
+
outline-offset: 2px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
.viewer-image[data-v-befe605b] {
|
|
17
|
+
max-width: 90vw;
|
|
18
|
+
max-height: 90vh;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
}
|
|
21
|
+
.v-overlay--active[data-v-befe605b] {
|
|
22
|
+
backdrop-filter: blur(18px);
|
|
3
23
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,92 +1,100 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import
|
|
1
|
+
import { computed, createElementBlock, createElementVNode, createVNode, defineComponent, mergeProps, openBlock, resolveComponent, useTemplateRef, withCtx } from "vue";
|
|
2
|
+
import './index.css';//#region ../manifest/dist/index.mjs
|
|
3
3
|
var type = "IMAGE";
|
|
4
4
|
var name = "Image";
|
|
5
5
|
var initState = () => ({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
url: null,
|
|
7
|
+
alt: "",
|
|
8
|
+
assets: {}
|
|
9
9
|
});
|
|
10
|
-
var version = "1.0";
|
|
11
10
|
var ui = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// Does element support only full width or can be used within layouts
|
|
15
|
-
// (e.g. 50/50 layout)
|
|
16
|
-
forceFullWidth: false
|
|
11
|
+
icon: "mdi-image",
|
|
12
|
+
forceFullWidth: false
|
|
17
13
|
};
|
|
14
|
+
var isEmpty = (data) => !data.url;
|
|
18
15
|
var manifest$1 = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
type,
|
|
17
|
+
version: "1.0",
|
|
18
|
+
name,
|
|
19
|
+
ssr: false,
|
|
20
|
+
initState,
|
|
21
|
+
isEmpty,
|
|
22
|
+
ui
|
|
25
23
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/components/Display.vue?vue&type=script&setup=true&lang.ts
|
|
26
|
+
var _hoisted_1 = { class: "tce-image-root" };
|
|
27
|
+
var _hoisted_2 = ["aria-label"];
|
|
28
|
+
var _hoisted_3 = { class: "d-flex align-center justify-center fill-height" };
|
|
29
|
+
var _hoisted_4 = ["alt", "src"];
|
|
30
|
+
var Display_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
31
|
+
__name: "Display",
|
|
32
|
+
props: { element: {} },
|
|
33
|
+
setup(__props) {
|
|
34
|
+
const props = __props;
|
|
35
|
+
const closeBtn = useTemplateRef("closeBtn");
|
|
36
|
+
const url = computed(() => props.element.data.url);
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
const _component_VProgressCircular = resolveComponent("VProgressCircular");
|
|
39
|
+
const _component_VImg = resolveComponent("VImg");
|
|
40
|
+
const _component_VBtn = resolveComponent("VBtn");
|
|
41
|
+
const _component_VDialog = resolveComponent("VDialog");
|
|
42
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(_component_VDialog, {
|
|
43
|
+
"aria-label": "Image viewer",
|
|
44
|
+
"content-class": "d-flex align-center justify-center h-100 w-100",
|
|
45
|
+
transition: "fade-transition",
|
|
46
|
+
onAfterEnter: _cache[0] || (_cache[0] = ($event) => closeBtn.value?.$el?.focus())
|
|
47
|
+
}, {
|
|
48
|
+
activator: withCtx(({ props: overlayProps }) => [createElementVNode("button", mergeProps(overlayProps, {
|
|
49
|
+
"aria-label": `Open image viewer: ${__props.element.data.alt || "image"}`,
|
|
50
|
+
class: "image-viewer-activator"
|
|
51
|
+
}), [createVNode(_component_VImg, {
|
|
52
|
+
alt: __props.element.data.alt,
|
|
53
|
+
src: url.value,
|
|
54
|
+
class: "mx-auto",
|
|
55
|
+
rounded: "lg"
|
|
56
|
+
}, {
|
|
57
|
+
placeholder: withCtx(() => [createElementVNode("div", _hoisted_3, [createVNode(_component_VProgressCircular, {
|
|
58
|
+
"aria-label": "Loading image",
|
|
59
|
+
color: "blue-grey-darken-3",
|
|
60
|
+
indeterminate: ""
|
|
61
|
+
})])]),
|
|
62
|
+
_: 1
|
|
63
|
+
}, 8, ["alt", "src"])], 16, _hoisted_2)]),
|
|
64
|
+
default: withCtx(({ isActive }) => [createVNode(_component_VBtn, {
|
|
65
|
+
ref_key: "closeBtn",
|
|
66
|
+
ref: closeBtn,
|
|
67
|
+
"aria-label": "Close image viewer",
|
|
68
|
+
class: "position-absolute top-0 right-0",
|
|
69
|
+
color: "white",
|
|
70
|
+
icon: "mdi-close",
|
|
71
|
+
variant: "tonal",
|
|
72
|
+
onClick: ($event) => isActive.value = false
|
|
73
|
+
}, null, 8, ["onClick"]), createElementVNode("img", {
|
|
74
|
+
alt: __props.element.data.alt,
|
|
75
|
+
src: url.value,
|
|
76
|
+
class: "viewer-image"
|
|
77
|
+
}, null, 8, _hoisted_4)]),
|
|
78
|
+
_: 1
|
|
79
|
+
})]);
|
|
80
|
+
};
|
|
81
|
+
}
|
|
76
82
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region \0plugin-vue:export-helper
|
|
85
|
+
var _plugin_vue_export_helper_default = (sfc, props) => {
|
|
86
|
+
const target = sfc.__vccOpts || sfc;
|
|
87
|
+
for (const [key, val] of props) target[key] = val;
|
|
88
|
+
return target;
|
|
83
89
|
};
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/components/Display.vue
|
|
92
|
+
var Display_default = /* @__PURE__ */ _plugin_vue_export_helper_default(Display_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-befe605b"]]);
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region src/index.ts
|
|
95
|
+
var manifest = {
|
|
96
|
+
...manifest$1,
|
|
97
|
+
Display: Display_default
|
|
92
98
|
};
|
|
99
|
+
//#endregion
|
|
100
|
+
export { Display_default as Display, manifest as default };
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Tailor CMS image element end-user component",
|
|
4
4
|
"author": "Studion <info@gostudion.com> (https://github.com/tailor-cms)",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"version": "
|
|
6
|
+
"version": "2.0.0",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"import": "./dist/index.js",
|
|
@@ -16,19 +16,24 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"vue": "^3.5.
|
|
19
|
+
"vue": "^3.5.29"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@tailor-cms/eslint-config": "
|
|
23
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
24
|
-
"typescript": "^
|
|
25
|
-
"vite": "^
|
|
26
|
-
"
|
|
27
|
-
"
|
|
22
|
+
"@tailor-cms/eslint-config": "^2.0.1",
|
|
23
|
+
"@vitejs/plugin-vue": "^6.0.6",
|
|
24
|
+
"typescript": "^6.0.3",
|
|
25
|
+
"vite": "^8.0.10",
|
|
26
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
27
|
+
"vue-tsc": "^3.2.7",
|
|
28
|
+
"vuetify": "^4.0.6",
|
|
29
|
+
"@tailor-cms/ce-image-manifest": "2.0.0"
|
|
28
30
|
},
|
|
29
31
|
"publishConfig": {
|
|
30
32
|
"access": "public"
|
|
31
33
|
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=24"
|
|
36
|
+
},
|
|
32
37
|
"scripts": {
|
|
33
38
|
"dev": "vite build --watch",
|
|
34
39
|
"build": "pnpm nuke:dist && vue-tsc && vite build",
|